Forum Discussion

Ion_Ander's avatar
Ion_Ander
Icon for Helper I rankHelper I
4 years ago
Solved

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

 

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??

  • Replace All function with ALLEXCEPT

    hope this will work

1 Reply

  • Replace All function with ALLEXCEPT

    hope this will work