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
Ion_Ander
Helper I
Helper I

filter not afecting a measure

Hi,

I have created a measure to obtain the amount of purchases to providers, and this works more or less fine, but if try to add another filter thsi filter it´s not affecting, it shows the same value, no matter what you choose in the filter.

 

Here is the PBIX file.

This is the ralitionship between my tables

Ion_Ander_0-1639136426940.png

 

And the measure i created:

 

PURCHASE AMOUNT = 
var selectedProvider=SELECTEDVALUE('PROVIDERS DUPLICATE'[NIF])
VAR famSelec=SELECTEDVALUE(ARTICLES[FAMPRO NAME])
var OneValue= calculate(SUM('PURCHASE LINES'[IMPORTELIMPIO]),all(ARTICLES),PROVIDERS[NIF]=selectedProvider)

var resul=IF(
    HASONEVALUE('PROVIDERS DUPLICATE'[NIF]),
    OneValue,
    SUMX('PURCHASE LINES','PURCHASE LINES'[IMPORTELIMPIO])
)
return resul

 

 if i delete the part where i omit the filters appliedd to the articles table--all(articles)--, the filter works, but the values they give me it´s not correct.

So how i can i solve this??

1 ACCEPTED SOLUTION
mh2587
Super User
Super User

Replace All function with ALLEXCEPT

hope this will work


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

1 REPLY 1
mh2587
Super User
Super User

Replace All function with ALLEXCEPT

hope this will work


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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.