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 need to have this logic on my report page:
If a date is selected (in a column chart) then calculate the Running Total for that day, when no date is selected, calculate the running total just for the current month.
My measure is:
But when no date is selected in the column chart, my running total is wrong. Where am I doing wrong?
Solved! Go to Solution.
Hi @Anonymous
You can try this Measure.
RTRevenue-CM =
VAR MaxDate =
SELECTEDVALUE ( 'Calendar'[DateValue] )
RETURN
IF (
ISBLANK ( MaxDate ),
CALCULATE (
SUM ( Revenue[Revenue] ),
ALLEXCEPT ( 'Calendar', 'Calendar'[MonthNameYear] ),
'Calendar'[IsCurrentMonth] = 1
),
CALCULATE (
Revenue[Revenue Total],
FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[DateValue] <= MaxDate )
)
)
The result looks like this:
For more details, you can refer the attached pbix file.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can try this Measure.
RTRevenue-CM =
VAR MaxDate =
SELECTEDVALUE ( 'Calendar'[DateValue] )
RETURN
IF (
ISBLANK ( MaxDate ),
CALCULATE (
SUM ( Revenue[Revenue] ),
ALLEXCEPT ( 'Calendar', 'Calendar'[MonthNameYear] ),
'Calendar'[IsCurrentMonth] = 1
),
CALCULATE (
Revenue[Revenue Total],
FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[DateValue] <= MaxDate )
)
)
The result looks like this:
For more details, you can refer the attached pbix file.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |