Forum Discussion
khsingh
2 years agoRegular Visitor
Stacked Chart - how to split Y axis value based on X axis but consider total value to divide
Hi, in stacked chat i have used four columns on Y axis and two columns on X Axis and its connecetd to SSAS Tabular. the Y axis bars gets Splitted based on X axis but i want avoid one of the c...
Anonymous
2 years agoNot applicable
Hi khsingh
Please try this:
MEASURE =
VAR _currentdate =
MAX ( 'Table'[Date] )
RETURN
SUM ( 'Table'[Values] )
/ (
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _currentdate ),
'Table'[Values]
)
+ SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _currentdate ),
'Table'[Values2]
)
)
MEASURE 2 =
VAR _currentdate =
MAX ( 'Table'[Date] )
RETURN
SUM ( 'Table'[Values2] )
/ (
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _currentdate ),
'Table'[Values]
)
+ SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _currentdate ),
'Table'[Values2]
)
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
khsingh
2 years agoRegular Visitor
Hi,
Since we connected to tabular model , below field is not working.
Error : canccot find Name
- Anonymous2 years agoNot applicable
Hi khsingh
The measure is just a sample for your reference ,you need to change it to your own field, or you can not make it run.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.