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 all,
I have a measure like
CALCULATE ( Measure, Table2[Category] = "A" )
+ CALCULATE ( Measure, Table2[Category] = "B" )
+ CALCULATE ( Measure, Table2[Category] = "C" )
+ CALCULATE ( Measure, Table2[Category] = "D" )
+ CALCULATE ( Measure, Table2[Category] = "E" )
and so on...
Can I write it more compact? With a kind of running Filter?
Thanks for ideas.
Solved! Go to Solution.
Yes, you could do it like
Combined measure =
VAR summaryTable =
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Table2'[Category] ),
KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" })
),
"@val", [Base Measure]
)
RETURN
SUMX ( summaryTable, [@val] )
Thank you it worked 👍
The measure dont react to a slicer with A, B and C. Is it also possible to write it in such way that I can also filter it to A, B and C?
Yes, you could do it like
Combined measure =
VAR summaryTable =
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Table2'[Category] ),
KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" })
),
"@val", [Base Measure]
)
RETURN
SUMX ( summaryTable, [@val] )
You could do something like
Combined measure =
VAR summaryTable =
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Table2'[Category] ),
'Table2'[Category] IN { "A", "B", "C" }
),
"@val", [Base Measure]
)
RETURN
SUMX ( summaryTable, [@val] )
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 |
---|---|
114 | |
101 | |
78 | |
75 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |