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.
I would like to put 2 running totals for this year and the previous year on the same chart.
My calc for the running total is:
CALCULATE (
[Is SHEQ],
FILTER (
ALLSELECTED('EventYearMonth'[DateValue]),
'EventYearMonth'[DateValue] <= MAX ( 'EventYearMonth'[DateValue])
&& MAX('EventYearMonth'[DateValue]) <= TODAY() )
Rather than having a relative slicer on the visual with "this year". I would like to include it within the calculation. This way I can overlay the previous and current years.
Is this possible?
Solved! Go to Solution.
Hi @VendettaBob ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
IF(
YEAR(MAX('Table'[date]))=YEAR(TODAY()),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]<=TODAY()&&'Table'[date]>=DATE(YEAR(TODAY()),1,1))),
IF(
YEAR(MAX('Table'[date]))=YEAR(TODAY())-1 ,
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),
'Table'[date]>=DATE(YEAR(TODAY())-1,1,1)&&'Table'[date]<=DATE(YEAR(TODAY()),12,31)))))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @VendettaBob ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
IF(
YEAR(MAX('Table'[date]))=YEAR(TODAY()),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]<=TODAY()&&'Table'[date]>=DATE(YEAR(TODAY()),1,1))),
IF(
YEAR(MAX('Table'[date]))=YEAR(TODAY())-1 ,
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),
'Table'[date]>=DATE(YEAR(TODAY())-1,1,1)&&'Table'[date]<=DATE(YEAR(TODAY()),12,31)))))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@VendettaBob , Create a measure like
var _max1 = MAX ( 'EventYearMonth'[DateValue])
var _max = date(year(_max1), month(_max1)-12, day(_max1))
var _today = date(year(TODAY()), month(TODAY())-12, day(TODAY()))
return
CALCULATE (
[Is SHEQ],
FILTER (
ALLSELECTED('EventYearMonth'[DateValue]),
'EventYearMonth'[DateValue] <= _max
&& MAX('EventYearMonth'[DateValue]) <= _today ) )
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 |
---|---|
106 | |
94 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |