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.
Hi Experts
I am stuck on the following measure which is only returning back the result for the measure [18+] but excluding [52+] and so on
"18+" should be the sum of all the indivdual measure for [18+] + [52+] + [64+] + [70+] + [78+] + [90+] + [104+] - not just [18+]
Measure
Measure_Switch =
If(Hasonevalue(RTT[Type]),
Switch(Selectedvalue(RTT[Type]),
"Under 18",[Under_18],
"18+", [18+] + [52+] + [64+] + [70+] + [78+] + [90+] + [104+],
"52+",([52+] + [64+] + [70+] + [78+] + [90+] + [104+]),
"64+",([64+] + [70+] + [78+] + [90+] + [104+]),
"70+",([70+] + [78+] + [90+] + [104+]),
"78+",([78+] + [90+] + [104+]),
"90+",([90+] + [104+]),
"104+",([104+]),
"Clock Stop",[Clock_Stops]
))
Solved! Go to Solution.
Hi @Invesco,
I don't think there is a need to create these many measures. Why don't you try something like this:
Measure_Switch =
IF(HASONEVALUE(RTT[Type]),
SWITCH(SELECTEDVALUE(RTT[Type]),
"Under 18", SUMX('Table',IF('Table'[Value]<18,1,0)),
"18+", SUMX('Table',IF('Table'[Value]>=18 && 'Table'[Value]<52,1,0)),
"52+", SUMX('Table',IF('Table'[Value]>=52 && 'Table'[Value]<64,1,0)),
"64+", SUMX('Table',IF('Table'[Value]>=64 && 'Table'[Value]<70,1,0)),
"70+", SUMX('Table',IF('Table'[Value]>=70 && 'Table'[Value]<78,1,0)),
"78+", SUMX('Table',IF('Table'[Value]>=78 && 'Table'[Value]<90,1,0)),
"90+", SUMX('Table',IF('Table'[Value]>=90 && 'Table'[Value]<104,1,0)),
"104+",SUMX('Table',IF('Table'[Value]>=104,1,0))
))
Mark this post as a solution if that works for you!
Hi @Invesco,
can you please send us a screenshot from Excel with the columns of your table and the expected result . Without that it is difficult to give you help.
Hi @Invesco,
I don't think there is a need to create these many measures. Why don't you try something like this:
Measure_Switch =
IF(HASONEVALUE(RTT[Type]),
SWITCH(SELECTEDVALUE(RTT[Type]),
"Under 18", SUMX('Table',IF('Table'[Value]<18,1,0)),
"18+", SUMX('Table',IF('Table'[Value]>=18 && 'Table'[Value]<52,1,0)),
"52+", SUMX('Table',IF('Table'[Value]>=52 && 'Table'[Value]<64,1,0)),
"64+", SUMX('Table',IF('Table'[Value]>=64 && 'Table'[Value]<70,1,0)),
"70+", SUMX('Table',IF('Table'[Value]>=70 && 'Table'[Value]<78,1,0)),
"78+", SUMX('Table',IF('Table'[Value]>=78 && 'Table'[Value]<90,1,0)),
"90+", SUMX('Table',IF('Table'[Value]>=90 && 'Table'[Value]<104,1,0)),
"104+",SUMX('Table',IF('Table'[Value]>=104,1,0))
))
Mark this post as a solution if that works for you!
Hi The question is not about range of values but adding up individual measure that sum up to give [18+]
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 |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |