Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
One of the months has no data in my fact table and my running total measure works fine in terms of displaying the running total value in the blank month. However, I need to add a Max Transaction Date filter (highlighted below) from the Fact table as well to stop to curve at the last date.
And when I add this additonal filter, the running total measure shows blank value against that month.
Hi @theblueslover ,
1.What's the syntax for [1.0 Sum]? I could reproduce your issue when the [1.0 Sum]=SUM(FactTable[Value]), and it show blank for 2021/12/1:
2.What's the expected result for 2021/12/1? Do you want to get the last not blank value for it? In my example , like:
If so , please try:
New Sum =
var _date= IF([1.0 Sum]=BLANK(),MAXX(FILTER(ALLSELECTED(FactTable),[Transaction_date]<MAX('FactTable'[Transaction_date])),[Transaction_date]), MAX('FactTable'[Transaction_date]))
return SUMX(FILTER(ALL('FactTable'),[Transaction_date]=_date),[1.0 Sum])
Running Total 2 =
var maxdate = Calculate(MAX(FactTable[Transaction_date]))
return SUMX(
FILTER(
ALLSELECTED('Calendar'[Date]),
'Calendar'[Date]<=MAX('Calendar'[Date])
&&
'Calendar'[date]<=maxdate
),
[New Sum]
)
Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much for the reply. I have tried to apply the measures but couldnt make it work.
What I want to do is to stop the curve at the last period in which there is transactions in the fact table.
When I add the maximum date from the fact table into the running total measure this is what I get.
"DimDate[Month]<=maxdate" is the filter that causes this.
Sales running total =
var maxdate = MAX('Fact'[Dates])
return
CALCULATE(
SUM('Fact'[Sales]),
FILTER(
ALLSELECTED('DimDate'[Month]),
DimDate[Month]<=MAX(DimDate[Month]) && DimDate[Month]<=maxdate
)
)
User | Count |
---|---|
120 | |
67 | |
66 | |
57 | |
50 |
User | Count |
---|---|
176 | |
83 | |
69 | |
65 | |
54 |