The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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]))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
123 | |
111 | |
78 | |
74 |