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 guys,
I need your help again 🙂
I've implemented one of Alberto's awesome calculation items to get various measures to show the 12 months back values in charts. https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
To have this data I had to change my year + month slicer to the combo YYYYMM slicer.
All KPI's and charts are working fine except the YTD KPI card.
The KPI YTD card is currently showing the sum of all years in the source, and I can't get it to show the sumof months for the selected year in the year/month (YYYYMM) slicer.
I tried a bunch of DAX tweaking, to remove one filter context and push a different one but nothing is working. Can anyone help with this? I've referred to one of the member's code from the community but didn't work in my report.
Value ROS YTD =
Solved! Go to Solution.
Hi @Anonymous ,
I misunderstood it. I modify the formula like this:
KPI YTD =
CALCULATE (
SUM ( 'Table'[Sales] ),
DATESYTD ( 'Table'[Date] ),
REMOVEFILTERS ( 'Table'[Year-Month] )
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, I create a sample.
In my understanding, when you select a value in the Year-Month slicer, you want to get the sum sales of date in the selected year, here's my solution.
Create a measure.
KPI YTD =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
)
)
Get the result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-kalyj-msft,
Not quite what I need 🙂 since this shows the YTD for the last month 12-2021 or 06-2022. I need when I select 03-2022 to show 03-2022 YTD, now it shows 06-2022 YTD when 03-2022 is selected.
Hi @Anonymous ,
I misunderstood it. I modify the formula like this:
KPI YTD =
CALCULATE (
SUM ( 'Table'[Sales] ),
DATESYTD ( 'Table'[Date] ),
REMOVEFILTERS ( 'Table'[Year-Month] )
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes this is it! 🙂 Thank you so much, I made a measure that worked but was way to long, this one works like a charm 🙂
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 |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |