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
J4ns3n
Frequent Visitor

Measure based on filter which overrules row context matrix

Hi,

Is there a way to create a measure based on a slicer selection which overrules the row context in a matrix?

So I have the following slicer, I created a measure which is based on country level. When I select a country it needs to show de local ledger (this is a different colum). When nothing is selected it needs to show the currency EURO which is a different column in my fact table. 

I created the next measure: 

if(DISTINCTCOUNTNOBLANK('DM_Table'[LedgerCurrencyCode])>1,
SUM(FACTS[CorporateAmount]),if(SELECTEDVALUE(SelectCurrency[SelectCurrency]) = "Euro",
 SUM(FACTS[CorporateAmount]),
 SUM(FACTS[LedgerAmount])))


The problem is now that in my matrix country level is used as a row, this has as an effect that my measure calculates the amount on local ledger level, but when nothing is selected in my slicer I need the measure to calculate NOT the local ledger. Eventually when 1 country is selected I want to see the local ledger. 

@amitchandak 


 

1 ACCEPTED SOLUTION
J4ns3n
Frequent Visitor

Thank you for your help, but the function ALLSELECTED() did the job. 

View solution in original post

3 REPLIES 3
J4ns3n
Frequent Visitor

Thank you for your help, but the function ALLSELECTED() did the job. 

Hi @J4ns3n ,

Could you please mark your post as Answered if your problem has been resolved? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

Hi @J4ns3n ,

In order to give you a suitable solution quickly, could you please provide some sample data in your tables (exclude sensitive data) with Text format, your matrix Fields settings and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Matrix Fields settingsMatrix Fields settings

Best Regards

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

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