Forum Discussion
Column as measure
- 4 years ago
Hi Anonymous ,
There are two ways to achieve it.
1. Unpivot columns Compared Budget Sales Year 2019 and Compared Budget Sales Year 2020.2. Create a new table showing the column names, then create the following measure and use the matrix visual.
Measure = SWITCH ( SELECTEDVALUE ( ColumnsName[Name] ), "Compared Budget Sales Year 2019", MAX ( 'Table 2'[Compared Budget Sales Year 2019] ), "Compared Budget Sales Year 2020", MAX ( 'Table 2'[Compared Budget Sales Year 2020] ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi selimovd,
Thanks for the reply.
I want to use multiple column in slicer as options.
For example:
Suppose I have 3 columns and those are like this:
| Sales | Compared Budget Sales Year 2019 | Compared Budget Sales Year 2020 |
| 200 | High | High |
| 300 | Low | High |
| 900 | Low | Low |
I would like to use slicer to show budget sales in 2019 and 2020 in one chart. In other words, if I click Compared Budget Sales Year 2019 in slicer, the chart shows information only based on data from column 'Compared Budget Sales Year 2019', and if I click Compared Budget Sales Year 2020 in slicer, the chart shows that only based on data from column Compared Budget Sales Year 2019.
I have tried many methods but unable to do this. I am new to Power BI so help would be really appreciated.
Thanks so much in advance
Best Regards,
Ali Asgar
Hi Anonymous ,
There are two ways to achieve it.
1. Unpivot columns Compared Budget Sales Year 2019 and Compared Budget Sales Year 2020.
2. Create a new table showing the column names, then create the following measure and use the matrix visual.
Measure =
SWITCH (
SELECTEDVALUE ( ColumnsName[Name] ),
"Compared Budget Sales Year 2019", MAX ( 'Table 2'[Compared Budget Sales Year 2019] ),
"Compared Budget Sales Year 2020", MAX ( 'Table 2'[Compared Budget Sales Year 2020] )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.