Hello @mdalton2100,
Thank You for posting your query onto the Forum.
Firstly, I created a table and added a “Sub-Category” column against the “Category” criteria. Below is the screenshot of the newly created table and the status of the relationship created between the source table and newly created table is provided for the reference -
Now, once the table is created and the relationship is established. I created two measures, one to calculate the results based on condition that you’ve specified and other one created just to fix the grand totals. Below are the measures provided for the reference -
Conditional Amount =
SWITCH( TRUE() ,
SELECTEDVALUE( 'Category and Sub-Category'[Category] ) = "X" &&
SELECTEDVALUE( 'Category and Sub-Category'[Sub-Category] ) = "A" ,
DIVIDE(
CALCULATE( SUM( 'Source Fact table'[Amt.] ) ,
'Source Fact table'[Category (v1)] = "X" ) ,
1.25 ,
0 ) * 25 / 100 ,
SELECTEDVALUE( 'Category and Sub-Category'[Category] ) = "X" &&
SELECTEDVALUE( 'Category and Sub-Category'[Sub-Category] ) = "B" ,
DIVIDE(
CALCULATE( SUM( 'Source Fact table'[Amt.] ) ,
'Source Fact table'[Category (v1)] = "X" ) ,
1.25 ,
0 ) ,
SELECTEDVALUE( 'Category and Sub-Category'[Category] ) = "Y" &&
SELECTEDVALUE( 'Category and Sub-Category'[Sub-Category] ) = "Y" ,
CALCULATE( SUM( 'Source Fact table'[Amt.] ) ,
'Source Fact table'[Category (v1)] = "Y" ) ,
SELECTEDVALUE( 'Category and Sub-Category'[Category] ) = "Z" &&
SELECTEDVALUE( 'Category and Sub-Category'[Sub-Category] ) = "Z" ,
CALCULATE( SUM( 'Source Fact table'[Amt.] ) ,
'Source Fact table'[Category (v1)] = "Z" ) ,
BLANK() )
Conditional Amount - Totals =
SUMX(
SUMMARIZE(
'Category and Sub-Category' ,
'Category and Sub-Category'[Category] ,
'Category and Sub-Category'[Sub-Category] ,
"@Totals" ,
[Conditional Amount] ) ,
[@Totals]
)
Once these two measures are created, you’ll be able to see the results in the table based on the condition that you’ve specified. Below is the screenshot of the final results provided for the reference -
I’m also attaching the working of the PBIX file for the reference purposes.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Thanks and Warm Regards,
Harsh
split category into sub-category - Harsh.pbix (42.9 KB)