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.
I want to use columns(categorical) as filter/slicer and then use the slicer to filter the plots/charts.
I am making new measures from the columns to use them in SWITCH condition to create filter/slicer. So maybe if I can get some help that would be really helpful
Hey Anonymous ,
can you give an example? I don't fully understand what you want to do.
If you want to use a column as a slicer you can just drag and drop the column in the slicer. Then the visuals will be filtered automatically.
When you reply please mark me like that Anonymous
Otherwise I will not see that you replied to the post.
Thank you and best regards
Denis
- Anonymous4 years agoNot applicable
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
- v-kkf-msft4 years agoCommunity Support
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.