Forum Discussion
If Query in Dax
Hello Poojara_D12,
thank you very much for your quick reply. And thank you very much for your help.
DAX is still absolutely new to me and I have only been working with Power BI for a few weeks... (I love it)
But I have an error message when i try to create the measure
A function of type ‘PREVIOUSDAY’ was used in a true/false expression that serves as a table filter expression. This is not permitted.
The original message in German is:
Eine Funktion vom Typ 'PREVIOUSDAY' wurde in einem True/False-Ausdruck verwendet, der als Tabellenfilterausdruck dient. Dies ist nicht zulässig.
Hi Sammy1965 ,
Base on your description, it seems like you want to the count of No_ which the date is before today. I created a sample pbix file(see the attachment), please check if that is what you want. You can update the formla of measure
[Warenausgänge gestern1] as below:
Warenausgänge gestern1 =
VAR _predate =
CALCULATE (
MAX ( 'Archiv_Gebuchte_Warenausgänge'[Posting Date] ),
FILTER (
ALLSELECTED ( 'Archiv_Gebuchte_Warenausgänge' ),
'Archiv_Gebuchte_Warenausgänge'[Posting Date] < TODAY ()
)
)
RETURN
CALCULATE (
COUNT ( 'Archiv_Gebuchte_Warenausgänge'[No_] ),
FILTER (
ALLSELECTED ( 'Archiv_Gebuchte_Warenausgänge' ),
'Archiv_Gebuchte_Warenausgänge'[Posting Date] = _predate
)
)
Best Regards