The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a simple table with product week number and a running total measure:
Running Total =
var maxdate = MAX(week)
return
CALCULATE(SUM(quantity),week<=maxdate)
Product | 14 | 15 | 16 |
Macbook | 20 | 40 | 60 |
PC | 10 | 20 |
My problem is that I am not getting the running total for product PC week 16. I want it to display 20
There is no data for that week in the table which is just Product/Week/Quantity.
I tried linking it to a time table, but I still get the same issue
Hello @PowerBITestingG,
Could you please try this:
Running Total =
VAR MaxDate = MAX(week)
RETURN
CALCULATE(
SUM(quantity),
FILTER(
ALL(week),
week <= MaxDate
&& (ISBLANK(SUM(quantity)) || week > Max(week[week]))
)
)
Let me know if you might need further assistance.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
80 | |
75 | |
52 | |
50 |
User | Count |
---|---|
133 | |
124 | |
78 | |
64 | |
61 |