Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello , please i need some help is there any way to calculate the number of days of an YTD ??
Thank you
Solved! Go to Solution.
Hello,
there are two ways I can tell you by now.
Adapting @Greg_Deckler you can make the year dynamic.
Measure = DATEDIFF(DATE(YEAR(TODAY(),1,1),TODAY(),DAY)
If you have a DateTable, which is many cases highly recommended you could use
Measure = COUNTROWS(DATESYTD(DateTable))
Something like:
Measure = DATEDIFF(DATE(2018,1,1),TODAY(),DAY)
thank you for your response , but is there another way to make it dinamically , means that it take the date automatically exemple if we were in 201 , i habe to change (2018,1,1) b myself to (2019,1,1) and i want it to be dynamic ( not static)
Hello,
there are two ways I can tell you by now.
Adapting @Greg_Deckler you can make the year dynamic.
Measure = DATEDIFF(DATE(YEAR(TODAY(),1,1),TODAY(),DAY)
If you have a DateTable, which is many cases highly recommended you could use
Measure = COUNTROWS(DATESYTD(DateTable))
simply awesome..saved my day 🙂
Hi .. wondering if you can advise .. I keep getting an error when using this function:
Measure = DATEDIFF(DATE(YEAR(TODAY(),1,1),TODAY(),DAY)
Too many arguments were passed to the YEAR function. The maximum argument count for the function is one.
Hi,
Try this
Measure = DATEDIFF(DATE(YEAR(TODAY()),1,1),TODAY(),DAY)
@asmagh,
Create new a new table using DAX below.
Date = CALENDAR("2018/1/1","2019/12/31")
Create measure using DAX below.
Measure = IF(MAX('Date'[Date])<=TODAY(),DATEDIFF(MAX('Date'[Date]),TODAY(),DAY),DATEDIFF(TODAY(),MAX('Date'[Date]),DAY))
Use slicer to filter your measure.
Regards,
Lydia
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
87 | |
65 | |
50 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |