Forum Discussion

SagarChauhan1's avatar
5 months ago
Solved

Parameter slicer with measure for multiple columns

 

 

Hello, I need 1 column where i can get total of all selected columns in slicer.

  • Hi SagarChauhan1 ,

     

    You can either create a calculated column or a measure and then add them to the field parameter to achieve this, best is to create a measure instead of calculated column.

     

    I've created a sample solution for you, refer attached .pbix file.

     

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together! 

8 Replies

  • Hi SagarChauhan1 ,

     

    You can either create a calculated column or a measure and then add them to the field parameter to achieve this, best is to create a measure instead of calculated column.

     

    I've created a sample solution for you, refer attached .pbix file.

     

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together! 

  • Hello grazitti_sapna 

    Here when i select more than 1 slicer then nothing is happneing where as i need only one column with single or multiple selections in slicer.
    Eg: If Mfg Cost is 10, Duty is 2 and Royalty is 3 then Total cost would be 15 but if i select Mfg Cost and Duty from slicer then my answer should be 12.

  • Step 1) Create a dynamic total measure

    Selected Total :=
    VAR _Selected =
        VALUES ( 'Parameter'[Parameter] )
    RETURN
        SUMX (
            _Selected,
            SWITCH (
                TRUE(),
                'Parameter'[Parameter] = "Mfg Cost", [Mfg Cost],
                'Parameter'[Parameter] = "Duty", [Duty],
                'Parameter'[Parameter] = "Royalty", [Royalty]
            )
        )

     

    Step 2) Use it in your table

    Add this measure as a new column in your matrix/table

  • Hi SagarChauhan1 

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


    Thank you.

  • Hi SagarChauhan1 

    May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


    Thank you