The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey guys,
hope you can help me out with this one.
I have a filter on month names (for simplicity let's imply the year is always 2022):
And another slicer that allows period selection (MTD/Full). I'm already calculating the sum over the selected period.
Now, what I want to achieve is, that it is only calculating the sum and displaying it in a bar chart for the most recent month selected (e.g. March) when the user has MTD selected.
I did the calculation like that:
Solved! Go to Solution.
@Anonymous , Create a measure
measure =
var _max = eomonth(maxx(allselected(Dates) , Dates[Date]) ,0)
return
calculate(sum(Table[Value]), filter(Dates, eomonth(Dates[Date],0) =_max)
@Anonymous , Create a measure
measure =
var _max = eomonth(maxx(allselected(Dates) , Dates[Date]) ,0)
return
calculate(sum(Table[Value]), filter(Dates, eomonth(Dates[Date],0) =_max)
@amitchandak
Thanks for your reply. Solved my issue with the MTD calculation. But I'm not able to transfer your example to a YTD calculation. If a user selects YTD, I want to show all months of the most recent year in a bar chart, despite the fact that the user might have not selected all months. How do I deal with this?
Appreciate your help!
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |