Forum Discussion
WendyDUFE
Helper III
6 years agoMatrix Table Drill Down
I am working on a matrix table to display the budget and actual data. Budget and actual data are from two separate fact tables, they are relationship with region dimension table. However, budget ...
- 6 years ago
Hi WendyDUFE ,
Try this:
Measure = VAR Value_ = SWITCH ( TRUE (), ISINSCOPE ( 'Dimension'[District] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[District], 'Dimension'[District] ) ), ISINSCOPE ( 'Dimension'[City] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[City], 'Dimension'[City] ) ), ISINSCOPE ( 'Dimension'[Province] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[Province], 'Dimension'[Province] ) ), ISINSCOPE ( 'Dimension'[Country] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[Country], 'Dimension'[Country] ) ) ) RETURN IF ( ISBLANK ( Value_ ), "-", Value_ )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Hi WendyDUFE ,
Try this:
Budget Amount = VAR Value_ = SWITCH ( TRUE (), ISINSCOPE ( 'Dimension'[District] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[District], 'Dimension'[District] ) ), ISINSCOPE ( 'Dimension'[City] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[City], 'Dimension'[City] ) ), ISINSCOPE ( 'Dimension'[Province] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[Province], 'Dimension'[Province] ) ), ISINSCOPE ( 'Dimension'[Country] ), CALCULATE ( SUM ( Budget[Amount] ), USERELATIONSHIP ( Budget[Country], 'Dimension'[Country] ) ), SUM ( Budget[Amount] ) // ----------------added--------------------------// ) RETURN IF ( ISBLANK ( Value_ ), "-", Value_ )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WendyDUFE
Helper III
6 years agoThanks Icey
I have accepted this solution, but one small item need your help, I noticed the total row in the buttom of the table is blank, is there a way to have the total amount displayed ?
Thank you
Icey
Community Support
6 years agoHi WendyDUFE ,
Try this:
Budget Amount =
VAR Value_ =
SWITCH (
TRUE (),
ISINSCOPE ( 'Dimension'[District] ),
CALCULATE (
SUM ( Budget[Amount] ),
USERELATIONSHIP ( Budget[District], 'Dimension'[District] )
),
ISINSCOPE ( 'Dimension'[City] ),
CALCULATE (
SUM ( Budget[Amount] ),
USERELATIONSHIP ( Budget[City], 'Dimension'[City] )
),
ISINSCOPE ( 'Dimension'[Province] ),
CALCULATE (
SUM ( Budget[Amount] ),
USERELATIONSHIP ( Budget[Province], 'Dimension'[Province] )
),
ISINSCOPE ( 'Dimension'[Country] ),
CALCULATE (
SUM ( Budget[Amount] ),
USERELATIONSHIP ( Budget[Country], 'Dimension'[Country] )
),
SUM ( Budget[Amount] ) // ----------------added--------------------------//
)
RETURN
IF ( ISBLANK ( Value_ ), "-", Value_ )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.