Forum Discussion
Slicer by columns name
- 9 years ago
Hi Anonymous,
I would solve this using a measure do the following:
- Create a table (do not related this with any other tables with the following structure:
- Name Slicer - Selection: Unity_Price, Tax_1, Tax_2, Tax_3, Tax_4
- Add the following measure to your data table:
Final_Price = VAR Unity_price = IF ( CONTAINS ( Slicer, Slicer[Selection], "Unity_Price" ) = TRUE (), SUM ( Sales[Unity_Price] ), 0 ) VAR Tax1 = IF ( CONTAINS ( Slicer, Slicer[Selection], "Tax_1" ) = TRUE (), SUM ( Sales[Tax_1] ), 0 ) VAR Tax2 = IF ( CONTAINS ( Slicer, Slicer[Selection], "Tax_2" ) = TRUE (), SUM ( Sales[Tax_2] ), 0 ) VAR Tax3 = IF ( CONTAINS ( Slicer, Slicer[Selection], "Tax_3" ) = TRUE (), SUM ( Sales[Tax_3] ), 0 ) VAR Tax4 = IF ( CONTAINS ( Slicer, Slicer[Selection], "Tax_4" ) = TRUE (), SUM ( Sales[Tax_4] ), 0 ) RETURN Unity_price + Tax1 + Tax2 - Tax3 - Tax4- Now just add the valuies from the table you created to a slicer and your measure to the table should give the expected result:
Regards,
MFelix
- Create a table (do not related this with any other tables with the following structure:
Hi MFelix ,
I am trying to achieve something similar and I really like the Dynamic hierarchies option and is also suitable for my requirement. I have created a new table using the DAX query and joined with the main table, the totals in the two result sets is same but the breakdown is not right. I am not sure why this is happening, please tell me if I am missing anything.
Results from New TableResults from Main Table
Thanks in advance
HI Anonymous ,
Without any specification and data about your model is difficul to give you an answrr, but have you checked if you hierarchy model is linked in a many to many relationship and with cross filtering active?
Can you share your file? If information is sensitive do a mockup file or shared it trough private message.
Regards,
MFelix