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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
giuliapiazza94
Helper IV
Helper IV

Filter on total and not subcategory

Hi guys,

I've a problem. I've a matrix like this:

 

giuliapiazza94_0-1655453745688.png

I'd want to filter customers with delta sales (total) < 0 but if I set the page filter

 

giuliapiazza94_1-1655453878956.png

 

 

I get

 

giuliapiazza94_2-1655453922058.png

So, it removes all delta sales > 0, while I want them too because I'd want to filter only total and not subcategory.

 

Have you any ideas?

Thank you all 😁

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @giuliapiazza94 

Create a measure like this :

Measure = 
var _a=CALCULATE([Delta sales],ALLEXCEPT(Foglio1,Foglio1[Customer])) 
var _b=[Delta sales]
return IF(_a>0,_b,BLANK())

Then add the measure in your Matrix visual , you will get a result like this :

Ailsamsft_0-1656310681521.png

In visual filter , set measure is not blank , the final result is as shown :

Ailsamsft_1-1656310723118.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
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

7 REPLIES 7
v-yetao1-msft
Community Support
Community Support

Hi @giuliapiazza94 

Create a measure like this :

Measure = 
var _a=CALCULATE([Delta sales],ALLEXCEPT(Foglio1,Foglio1[Customer])) 
var _b=[Delta sales]
return IF(_a>0,_b,BLANK())

Then add the measure in your Matrix visual , you will get a result like this :

Ailsamsft_0-1656310681521.png

In visual filter , set measure is not blank , the final result is as shown :

Ailsamsft_1-1656310723118.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

it works but if I use a calendar to filter year the measure goes crazy. I've tried to solve the problem.

Can you help me again please? 😢

 

https://drive.google.com/drive/folders/1396dUgbZcALj2d4ySvj1sYHbShYMTfrx?usp=sharing

v-yetao1-msft
Community Support
Community Support

Hi @giuliapiazza94 

Please follow the steps in the link .

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 

Ailsamsft_0-1655966959191.png

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you so much

The file pbix:

 

https://drive.google.com/drive/folders/1396dUgbZcALj2d4ySvj1sYHbShYMTfrx?usp=sharing

 

In the example, Robert has a positive total delta sales ( = 25)

 

giuliapiazza94_0-1655976973260.png

So, i set a filter "delta sales" > 0. But, I'd like to see all Robert's delta sales, the negative too. (B -17, D -10)

But, if I set "delta sales" > 0 the negative delta disappear, so I'd like to filter only total delta sales

v-yetao1-msft
Community Support
Community Support

Hi @giuliapiazza94 

I do not quite understand what you mean . Do you want to filter out data with total>=0? But if N3050 such > 0 data will not be filtered ? If so, can you provide your sample or pbix file(remove sensitive info) so that we can better deal with the problem . 

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

How can I attach a .pbix file?

SpartaBI
Community Champion
Community Champion

@giuliapiazza94 I don't know your column names but let's say you have there 'Table'[Customer] and 'Table[N] columns.
Write this measure:
CALCULATE(SUM('Table'[delta sales]), REMOVEFILTERS('Table[N]).

Put that measure on the visual filter pane and make it to be greater than 0.
This will keep all the relevant customers with all their data.


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors