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.
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/
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 |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |