Forum Discussion
Slicer for Columns values
Hi,
I have the following table
I can create a new column to calculate the total sales of each Model or to calculate the sales during each month
but the problem is I want to know the model year (or use model year as a slicer)
How can I do that?
Yes, You can use the summarize table and union to achieve the same in DAX. Or can also be done by using unpivot code in the M language.
Refer -https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax
https://community.powerbi.com/t5/Desktop/Columns-to-Rows/td-p/136649
https://community.powerbi.com/t5/Desktop/Union-two-tables-with-different-columns-names/td-p/141153
3 Replies
- amitchandakSuper User
You can use unpivot: https://radacad.com/pivot-and-unpivot-with-power-bi
- amaniramahiHelper V
thanks amitchandak , but the table I have is much more complicated, and have other columns that I still need them as columns to use them in filters and other slicers
I thought if there's maybe another way to create a separate table contains the sum of qty for each Model year but st the same time have a relationship with the main table to keep the data linked.
- amitchandakSuper User
Yes, You can use the summarize table and union to achieve the same in DAX. Or can also be done by using unpivot code in the M language.
Refer -https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax
https://community.powerbi.com/t5/Desktop/Columns-to-Rows/td-p/136649
https://community.powerbi.com/t5/Desktop/Union-two-tables-with-different-columns-names/td-p/141153