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.
I hope someone can help me. I have tried a number of different calculations by nothing is really working.
What formula do I need to calculate the number of days left in the year?
What formula do I need to show the % of the year that has elapsed?
Thank you!
Solved! Go to Solution.
Please ues the DAX below.
DayOfYear = DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), 'Date'[Date], DAY ) + 1
Elapsed = (DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), 'Date'[Date], DAY ) + 1)/(DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), DATE ( YEAR ( 'Date'[Date]), 12, 31 ), DAY ) + 1)
Regards,
Charlie Liao
Please ues the DAX below.
DayOfYear = DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), 'Date'[Date], DAY ) + 1
Elapsed = (DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), 'Date'[Date], DAY ) + 1)/(DATEDIFF ( DATE ( YEAR ( 'Date'[Date]), 1, 1 ), DATE ( YEAR ( 'Date'[Date]), 12, 31 ), DAY ) + 1)
Regards,
Charlie Liao
Thanks for the reply Charlie. I made a simply tabe with a date colum in this format 1/1/2017 and included all dates to 12/31/2017. I tried both DAX formulas in two different colums (DayOfYear and Elapsed) and keep getting this error:
Too many arguments were passed to the YEAR function. The maximum argument count for the function is 1
Can you advise?
Thanks!
Olivia
I tried it again and your solution worked perfectly! Thank you!!
How do i get todays information to show up now in my card visualization? Do I need to create a measure?
I would like to be able to refresh and have it will always bring in the correct % through the year (year elapsed).
How do i get todays information to show up now in my card visualization? Do I need to create a measure?
I would like to be able to refresh and have it will always bring in the correct % through the year (year elapsed).
You can just create a measure like
today = TODAY() to get current date, and show this measure in a card visual.
Regards,
Charlie Liao
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 |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
217 | |
89 | |
82 | |
66 | |
57 |