Forum Discussion

Matt78's avatar
Matt78
Helper II
2 years ago
Solved

Calculate difference between value and total value

Hi all,   I would like to have DAX that measures customer group sales index only.   For example here I have sales indexes of customer groups and customers related to them. If I filter a single cu...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Matt78 

    thanks for lbendlin's concern about this issue.

     

    Since you didn't provide a dataset for testing, I assumed some data for testing and hope it helps: 

     

    You can then create a Measure: 

    SelectedCustomerGroup = 
    CALCULATE (
        VALUES ( 'Sales'[CustomerGroup] ),
        FILTER ( 'Sales', 'Sales'[Customer] = SELECTEDVALUE ( 'Sales'[Customer] ) )
    )
    

     

    Then add a Slicer visual and a Table visual. Here is the test result: 

     

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you. 

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.