Forum Discussion
adding 2 bars
- Anonymous3 years ago
Hi Guneet_B21 ,
I think there should be a [Type] column and a [Cal] column in your table. We need to create a table with all data you need and add the column into X aixs.
Here I create an easy sample to have a test.
Data table:
X axis table:
X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})Relationship:
Measure:
Measure = VAR _Cal = SUM ( 'Table'[Cal] ) VAR _Total = CALCULATE ( SUM ( 'Table'[Cal] ), ALLSELECTED ( 'Table' ) ) VAR _ffandts = CALCULATE ( SUM ( 'Table'[Cal] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Type] IN { "ff", "ts" } ) ) RETURN IF ( ISBLANK ( _Cal ), SWITCH ( SELECTEDVALUE ( 'X axis'[Type] ), "Total", _Total, "ff+ts", _ffandts ), _Cal )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Guneet_B21 ,
I think there should be a [Type] column and a [Cal] column in your table. We need to create a table with all data you need and add the column into X aixs.
Here I create an easy sample to have a test.
Data table:
X axis table:
X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})
Relationship:
Measure:
Measure =
VAR _Cal =
SUM ( 'Table'[Cal] )
VAR _Total =
CALCULATE ( SUM ( 'Table'[Cal] ), ALLSELECTED ( 'Table' ) )
VAR _ffandts =
CALCULATE (
SUM ( 'Table'[Cal] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Type] IN { "ff", "ts" } )
)
RETURN
IF (
ISBLANK ( _Cal ),
SWITCH ( SELECTEDVALUE ( 'X axis'[Type] ), "Total", _Total, "ff+ts", _ffandts ),
_Cal
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
there were some draw backs with this as well as i had seperate measures to execute the on and in this case it had to be done on columns.
I went and took a different route so i dont think i need to execute this now.
Thanks alot for your help, really appreciate it