Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Matt78
Helper II
Helper II

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 customers, then index of a customer group filters also. I would like to view what was customer group index while I filter a single customer.

 

I don't use matrix to view customer group index but a different visual..

Matt78_1-1723625837221.png

 

 

BR

Matt

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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: 

vfenlingmsft_0-1723705674023.png

 

vfenlingmsft_1-1723705674024.png

You can then create a Measure: 

vfenlingmsft_2-1723705707695.png

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: 

vfenlingmsft_3-1723705707696.png

 

 

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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: 

vfenlingmsft_0-1723705674023.png

 

vfenlingmsft_1-1723705674024.png

You can then create a Measure: 

vfenlingmsft_2-1723705707695.png

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: 

vfenlingmsft_3-1723705707696.png

 

 

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.

lbendlin
Super User
Super User

Most likely you are looking for REMOVEFILTERS

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.