Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
hiii, currently I am doing cumulative line chart and i want to sort it based on country. But after i use the below measure, what i get is that for all country is the same value. It suppose to have different line and value for each country. Can someone help me figure this out? Thank you so muchh.
And also i need to do a weekly cumulative line chart, can anyone show me the steps on how to do it? thanks in advance
Solved! Go to Solution.
The ALL() function removes the country filter context. You need to preserve that filter context to separate countries.
I'd probably write the measure something like this:
Cumulative S1 =
VAR _Max = MAX ( Sheet1[Attribute] )
RETURN
CALCULATE (
SUM ( Sheet1[Value] ),
ALLSELECTED ( Sheet1 ),
VALUES ( Sheet1[COUNTRY] ),
Sheet1[Attribute] <= _Max
)
Recommended reading:
https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/
Hi @camelia_
Have you tried @AlexisOlson 's measure? It should work.
Since you have a Date table in the model, you can add a week column (or a YearWeek column) to it. Then use the week column for the weekly cumulative line chart.
Best regards,
Community Support Team_Jing
The ALL() function removes the country filter context. You need to preserve that filter context to separate countries.
I'd probably write the measure something like this:
Cumulative S1 =
VAR _Max = MAX ( Sheet1[Attribute] )
RETURN
CALCULATE (
SUM ( Sheet1[Value] ),
ALLSELECTED ( Sheet1 ),
VALUES ( Sheet1[COUNTRY] ),
Sheet1[Attribute] <= _Max
)
Recommended reading:
https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 6 | |
| 5 | |
| 4 | |
| 2 |