Forum Discussion
Anonymous
8 years agoNot applicable
% Days Complete DAX
Hi, I want to create a measure that calculates the percentage of days complete in a month. Ex: July has 31 days. Today is 7/19/2018. 19/31 = .612 We are 61% complete with th...
- 8 years ago
Hi Anonymous,
Please use the following formula.Measure = VAR Select_mon = SELECTEDVALUE ( Calendario[month] ) VAR Actual_mon = MONTH ( TODAY () ) RETURN SWITCH ( TRUE (), Actual_mon > Select_mon, 1, Actual_mon < Select_mon, 0, DIVIDE ( DAY ( TODAY () ), CALCULATE ( COUNTROWS ( 'Calendar' ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Year] = YEAR ( TODAY () ) && 'Calendar'[Month Number] = MONTH ( TODAY () ) ) ) ) )
Best Regards,
Angelia
Anonymous
8 years agoNot applicable
Perfect!
I get this error when attempting to change all date dimensions:
v-huizhn-msft
8 years agoMicrosoft Employee
Hi Anonymous,
You create a calculated measure, right? You should understand the difference between the Measure and Calculated Column. The measure returns a value, while Calculated Column returns a column. The Calculation you are trying to achieve is more suitable for calculated column, change to a calculated column and check if it works fine. Please connect me if there's any issue.
Thanks,
Angelia