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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pbi1908
Helper III
Helper III

A slicer filter a matrix but not a measure

Hi all, i have a problem, i have a table in which i have my Customer and the Open Balances which i have with this customer. I also have a slicer with a trader which is the people which traded that money with this customer. 

 

I want when i filter the slicer to see all the Customers which are related to this Trader, but in the Balance i want to see the whole amount for the customers and not the amount which came from this Trader. 

 

In my example you will find in the .pbix Trader B had trade only 5 euro with Deloitte and Trader C 256.  When i filter Trader B i want to see Deloitte since is a customer of Trader B and i want to see a summarized amount i.e 261.

 

If I use the ALL funciton the number is correct but my filter is now working, It doesn't filter at all the table. 

 

Thank you. 

 

 

 

https://drive.google.com/file/d/1sWZLMCH8Cg56jA_orYmuIr-eB6GOSJ9Y/view?usp=sharing

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

Hi @pbi1908 ,

 

I suggest you to try code as below.

Measure 2 = 
VAR _MEASURE =
    CALCULATE ( SUM ( BALANCE[BALANCES] ), ALL ( TRADER_ID[NAME] ) )
RETURN
    IF ( ISBLANK ( CALCULATE ( SUM ( BALANCE[BALANCES] ) ) ), BLANK (), _MEASURE )

Result is as below.

vrzhoumsft_0-1683014690719.png

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
pbi1908
Helper III
Helper III

That works thank you very much. Can you explain a bit the logic behind it ? 

 

As far as i understood you tried this because the measure will be never blank but how it gets filtered from the traders ?

Hi @pbi1908 ,

 

Here I just add a IF function, it will check whether the filter sum will return blank, if blank the measure will return blank directly.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hmm okk thanks @v-rzhou-msft , last question . 

 

What if i add another one component like in the updated .pbix, so i have also the Payment Terms which coming from another dimension table which is connected with the balances so they are getting filtered from Traders as well. 

 

What i want is still to see the, the customers of a Trader and the all the payment terms of this trader with the overall balance. 

 

 

https://drive.google.com/file/d/1aLUA2OnPc2qebgv4c98k9rcF-xZfiY-o/view?usp=sharing

v-rzhou-msft
Community Support
Community Support

Hi @pbi1908 ,

 

I suggest you to try code as below.

Measure 2 = 
VAR _MEASURE =
    CALCULATE ( SUM ( BALANCE[BALANCES] ), ALL ( TRADER_ID[NAME] ) )
RETURN
    IF ( ISBLANK ( CALCULATE ( SUM ( BALANCE[BALANCES] ) ) ), BLANK (), _MEASURE )

Result is as below.

vrzhoumsft_0-1683014690719.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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