Forum Discussion
Running Total in the Tooltip
- Anonymous4 years ago
I have a test in your sample. I think the incorrect result from the same meausre [RT] in your report page tooltip may be caused by filter and relationship. Here I suggest you to create an unrelated Month_Year Table to create a slicer and update your measures.
Unrelated Month Year = SUMMARIZE(d_Calendar,d_Calendar[Month_Year],d_Calendar[Ordem])Measures:
SUM_QTD = CALCULATE ( SUM ( f_Mov[Qtde] ), FILTER ( d_Calendar, d_Calendar[Month_Year] IN VALUES ( 'Unrelated Month Year'[Month_Year] ) ) )RT = CALCULATE ( SUM ( f_Mov[Qtde] ), FILTER ( ALL ( d_Calendar ), AND ( d_Calendar[Month_Year] IN VALUES ( 'Unrelated Month Year'[Month_Year] ), d_Calendar[Date] <= MAX ( d_Calendar[Date] ) ) ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
Hi Anonymous
Thank you so much for you help!
Thanks to your help I was able to find a solution to my problem.
The only things I've changed in your model was the measures and add a column with the last date of the month to your Unrelated Month Year :
I renamed your Unrelate Month Year table to AUX_CALENDAR.
AUX_CALENDAR =
SUMMARIZE(
d_Calendar,
d_Calendar[Month_Year],"LAST_DATE",LASTDATE(d_Calendar[Date])
)SUM_QTD =
CALCULATE(
SUM(f_Mov[Qtde]),
FILTER(
d_Calendar,
d_Calendar[Month_Year] in VALUES (AUX_CALENDAR[Month_Year])
)
)RT =
SWITCH(
TRUE(),
SELECTEDVALUE (AUX_CALENDAR[Month_Year]) in VALUES (d_Calendar[Month_Year]),
CALCULATE ( [SUM_QTD],
FILTER(
ALL(AUX_CALENDAR),
AUX_CALENDAR[LAST_DATE] <= MAX (d_Calendar[Date])
)
),
BLANK()
)And I made a relationship between the AUX_CALENDAR [Month_Year] and d_Calendar[Month_Year].
It works perfectly fine for me.
Below the pbix.
I create a sample to have a test. I suggest you to use ALL function instead of ALLSELECTED in your measure.
My Sample is as below.
f_Mov:
d_calendar:
d_calendar =
ADDCOLUMNS (
CALENDAR ( MIN ( f_Mov[Date] ), EOMONTH ( MAX ( f_Mov[Date] ), 0 ) ),
"Mont-Year", FORMAT ( [Date], "MMM-YY" ),
"YearMonth",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] )
)
Measure:
RT =
CALCULATE(
SUM ( f_Mov[qtd] ),
FILTER ( ALL(d_Calendar), d_Calendar[Date] <= MAX (d_Calendar[Date] )
))
Tooltip:
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- wiltonizaquiel4 years agoFrequent Visitor
Hi, Anonymous
Thanks for your answer!
Unfortunately it's not work... I need when the user filter the date, it shows the Running Total's only the date selected.
So if the user selected the Aug-21 and Sep-21, it should show:
Month-Year Qtd RT Aug-21 800 800 Sep-21 500 1300
And it's showing 944 and 1444 for the Aug-21 and Sep-21, respectively... 😕
Do you have another tips?
Thanks!