Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi - I'm trying to create a measure which calculates the % of days elapsed for each month/quarter/year. I was able to create a measure which shows the % of time elapsed for the current month but need this to calculate the % for each month seperately and also roll up to the quarter and year.
See below for the visual:
The measure I used:
Solved! Go to Solution.
Hi @johna123 ,
Do you want to show the result of measure or measure 2?
Measure =
var _month = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(DimDate,DimDate[Date]<=TODAY()))
var _Quarter = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(ALLSELECTED(DimDate),DimDate[Year-Quarter]=MAX(DimDate[Year-Quarter])))
var _each =
IF(
ISINSCOPE(DimDate[month]),_month,_Quarter)
return
DIVIDE(_each,_Quarter)
Measure 2 =
var _month = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(DimDate,DimDate[Date]<=TODAY()))
var _Quarter = DISTINCTCOUNT(DimDate[Date])
return
DIVIDE(_month,_Quarter)
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi @johna123 ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution.
If the above posts help, please kindly mark it as a solution to help others find it more quickly.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @johna123 ,
Do you want to show the result of measure or measure 2?
Measure =
var _month = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(DimDate,DimDate[Date]<=TODAY()))
var _Quarter = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(ALLSELECTED(DimDate),DimDate[Year-Quarter]=MAX(DimDate[Year-Quarter])))
var _each =
IF(
ISINSCOPE(DimDate[month]),_month,_Quarter)
return
DIVIDE(_each,_Quarter)
Measure 2 =
var _month = CALCULATE(DISTINCTCOUNT(DimDate[Date]),FILTER(DimDate,DimDate[Date]<=TODAY()))
var _Quarter = DISTINCTCOUNT(DimDate[Date])
return
DIVIDE(_month,_Quarter)
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
@johna123 , Not very clear. Try a measure like
divide(calculate( count(Date[Date]), Date[Date]<=today()),count(Date[Date]))
User | Count |
---|---|
94 | |
86 | |
78 | |
72 | |
66 |
User | Count |
---|---|
115 | |
106 | |
85 | |
65 | |
64 |