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.
I like to create a matrix table that show both my categories and a partial subgroup in one column in the same table. My expected output is like this:
Category | Sum |
A | 25 |
B | 28 |
C | 33 |
Subcategory (A+B+C) | 86 |
D | 34 |
Grand Total | 120 |
Dataset is like this:
Category | Value |
A | 12 |
A | 23 |
B | 13 |
B | 15 |
C | 16 |
C | 17 |
D | 15 |
D | 19 |
Solved! Go to Solution.
Hi @danguy2099
Not so pretty but it works. Start by creatinga filter table (Categories)
Categories =
SELECTCOLUMNS (
{ ( "A", 1 ), ( "B", 2 ), ( "C", 3 ), ( "Subcategory (A+B+C)", 4 ), ( "D", 5 ) },
"Category", [Value1],
"Index", [Value2]
)
SUM =
IF (
ISEMPTY ( 'Dataset' ),
CALCULATE (
SUM ( 'Dataset'[Value] ),
'Dataset'[Category] IN { "A", "B", "C" },
ALL ( 'Dataset' )
),
SUM ( 'Dataset'[Value] )
)
Works as intended. Thanks
Hi @danguy2099
Not so pretty but it works. Start by creatinga filter table (Categories)
Categories =
SELECTCOLUMNS (
{ ( "A", 1 ), ( "B", 2 ), ( "C", 3 ), ( "Subcategory (A+B+C)", 4 ), ( "D", 5 ) },
"Category", [Value1],
"Index", [Value2]
)
SUM =
IF (
ISEMPTY ( 'Dataset' ),
CALCULATE (
SUM ( 'Dataset'[Value] ),
'Dataset'[Category] IN { "A", "B", "C" },
ALL ( 'Dataset' )
),
SUM ( 'Dataset'[Value] )
)
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |