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.
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
)
)
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 |
---|---|
107 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
142 | |
104 | |
104 | |
80 | |
66 |