Forum Discussion
Quickly DAX measure fix - Filter
- 6 years ago
hej pawelj795
W pliku ktory wyslales nie bylo tego obiektu wiec musiale go wylachys z formuly.
Zalaczylem plik z formua.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Hi pawelj795
Try something like this.
Aging =
VAR ItemID = SELECTEDVALUE( WH_Invent_Trans[ItemID] )
RETURN
DATEDIFF(
MAXX(
FILTER(
ALL( WH_Invent_Trans );
WH_Invent_Trans[ItemID] = ItemID
&& WH_Invent_Trans[TransType] IN { 0, 9 }
&& WH_Invent_Trans[QTY] <> BLANK
);
WH_Invent_Trans[Date Physical]
);
TODAY()-1;
DAY
)
Mariusz
If this post helps, then please consider Accepting it as the solution.
- pawelj7956 years ago
Post Prodigy
That works, thanks 😉
Now, I want to develop this measure.Groups = VAR ItemID = SELECTEDVALUE(WH_Invent_Trans[ItemID]) VAR DateDifference = DATEDIFF( MAXX( FILTER(WH_Invent_Trans; WH_Invent_Trans[ItemID]=ItemID && WH_Invent_Trans[TransType] IN {0;9} && WH_Invent_Trans[QTY] <> BLANK() ); WH_Invent_Trans[Date Physical]); TODAY()-1; DAY) RETURN CALCULATE( SUM( WH_Invent_Trans[Inventory Value EUR]); DATESYTD(DimDates[Date]); DateDifference > 0 && DateDifference<= 15)
But it doesn't work.
It shows:
the true/false expression does not specify a column. Each true/false expressions used as table filter expression must refer to exactly one column- Mariusz6 years ago
Community Champion
Hi pawelj795
You can not use variable or && as a CALCULATE filter argument.Can you create a small data sample and explain the result? seeing data and expected result always helps.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution. - pawelj7956 years ago
Post Prodigy
Mariusz
Niestety to nie pomoglo, nadal wartości są z kosmosu.
Czy możesz mi wytłumaczyć co w formule zmieniło dodanie ALL do ostatniego CALCULATE?
Moze w ten sposob bede w stanie zidentyfikowac problem.- Mariusz6 years ago
Community Champion
Hi pawelj795
ALL( dimDate ) usunelow filtry z dimDate, to umozliwilo ( Running Total ) jak z DATESYTD tylko od pierwszej date w tabeli.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn