Forum Discussion
Pbiuserr
4 years agoPost Prodigy
Grouping one value in a chart
Hello, I have dimension table like down below and a measure to countrows from fact table for each representation (and LY in another meausure) Zone Category Europe Global Asia Global...
- 4 years ago
Hi,
One of ways to achieve this is to create a Axis table like below, and write a measure by using TREATAS function.
Pleases check the below picture and the attached pbix file.
Value measure: = SWITCH ( TRUE (), SELECTEDVALUE ( 'Axis'[Axis] ) = "Local", CALCULATE ( SUM ( 'Fact'[Value] ), TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Category] ) ), CALCULATE ( SUM ( 'Fact'[Value] ), TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Zone] ) ) )
Jihwan_Kim
4 years agoSuper User
Hi,
One of ways to achieve this is to create a Axis table like below, and write a measure by using TREATAS function.
Pleases check the below picture and the attached pbix file.
Value measure: =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Axis'[Axis] ) = "Local",
CALCULATE (
SUM ( 'Fact'[Value] ),
TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Category] )
),
CALCULATE (
SUM ( 'Fact'[Value] ),
TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Zone] )
)
)
Pbiuserr
4 years agoPost Prodigy
Thank you, really cool work! 🙂