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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-fenling-msft
Community Support
Community Support

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
v-fenling-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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