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.
Can anyone help me with the YTD Average calculation?
I have a table visual as shown below. "A" and "B" are DAX calculations which are giving me % calculations by each month.
Now, I need to create YTD A and YTD B calculations using DAX
Region | Dates | A | B | YTD A | YTD B |
ABC | 1/1/2019 | 82% | 40% | ||
ABC | 2/1/2019 | 88% | 12% | ||
ABC | 3/1/2019 | 119% | 22% | ||
ABC | 4/1/2019 | 67% | 35% | ||
ABC | 5/1/2019 | 46% | 45% | ||
ABC | 6/1/2019 | 55% | 55% | ||
ABC | 7/1/2019 | 29% | 65% | ||
ABC | 8/1/2019 | 34% | 90% | ||
ABC | 9/1/2019 | 26% | 45% |
Now If I filter on Date to select 8/1/2019 then I would expect something like this
I did this in excel
YTD A =AVERAGE(C2:C9)
YTD B =AVERAGE(D2:D9)
Region | Dates | A | B | YTD A | YTD B |
ABC | 8/1/2019 | 34% | 90% | 65% | 46% |
Any help would be really appreciated.
Thanks,
Fareed.,
Try Datesytd or totalytd
Year = CALCULATE(SUM(table[column]),DATESYTD('Date'[Date Filer]))
Last Year = CALCULATE(SUM(table[column]),DATESYTD(dateadd('Date'[Date Filer],-12,MONTH)))
Year Sales = CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),('Date'[Date Filer])))
Year Sales = CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),dateadd('Date'[Date Filer].-12,month)))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |