Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a fact table with data from the entire year.
I want to show the percentage of the month that is completed.
i.e:
January is 100%
February is 100%
March is 100%
April is 100%
May is 100%
June is 100%
July is 97%
I've created this measure to get my denominator:
EOMonth = day(ENDOFMONTH(DateDimension[Date]))
But I need a way to count the number of days in the selected month, based on the current date.
- My fact table has a last date of today().
- I want to show that all the previous months are 100% complete, and show progress of current month.
Any help?
Solved! Go to Solution.
@Anonymous
Try this MEASURE
Measure = VAR lastmonth = CALCULATE ( MONTH ( LASTDATE ( FactTable[Date] ) ), ALL ( FactTable ) ) VAR last_date = CALCULATE ( DAY ( LASTDATE ( FactTable[Date] ) ), ALL ( FactTable ) ) RETURN IF ( SELECTEDVALUE ( DateDimension[Date].[MonthNo] ) = lastmonth, DIVIDE ( last_date, [EOMonth] ), 1 )
@Anonymous
Try this MEASURE
Measure = VAR lastmonth = CALCULATE ( MONTH ( LASTDATE ( FactTable[Date] ) ), ALL ( FactTable ) ) VAR last_date = CALCULATE ( DAY ( LASTDATE ( FactTable[Date] ) ), ALL ( FactTable ) ) RETURN IF ( SELECTEDVALUE ( DateDimension[Date].[MonthNo] ) = lastmonth, DIVIDE ( last_date, [EOMonth] ), 1 )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |