Forum Discussion
question about decomp hierarchy
- Anonymous3 years ago
Hi Joe_0365 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure = SWITCH( TRUE(), ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="Transactions",SUMX(FILTER(ALL('Table'),'Table'[Group3]="Transactions"),[Value]), ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="avg$per transaction",AVERAGEX(FILTER(ALL('Table'),'Table'[Group3]="avg$per transaction"),[Value]), ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="avg item count per transaction",COUNTX(FILTER(ALL('Table'),'Table'[Group3]="avg item count per transaction"),[Value]), ISINSCOPE('Table'[Group2]),SUMX(FILTER(ALL('Table'),'Table'[Group2]=MAX('Table'[Group2])),[Value]), ISINSCOPE('Table'[Group1]),SUMX(ALL('Table'),[Value]))2. Result:
Whether it meets your expected results, if not, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Joe_0365 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
SWITCH(
TRUE(),
ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="Transactions",SUMX(FILTER(ALL('Table'),'Table'[Group3]="Transactions"),[Value]),
ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="avg$per transaction",AVERAGEX(FILTER(ALL('Table'),'Table'[Group3]="avg$per transaction"),[Value]),
ISINSCOPE('Table'[Group3])&& MAX('Table'[Group3])="avg item count per transaction",COUNTX(FILTER(ALL('Table'),'Table'[Group3]="avg item count per transaction"),[Value]),
ISINSCOPE('Table'[Group2]),SUMX(FILTER(ALL('Table'),'Table'[Group2]=MAX('Table'[Group2])),[Value]),
ISINSCOPE('Table'[Group1]),SUMX(ALL('Table'),[Value]))
2. Result:
Whether it meets your expected results, if not, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly