Forum Discussion
Taxidea_Taxus
Advocate I
2 years agoDAX Measure Returns (BLANK)
I have created a DAX measure to sum total sales for the previous calendar year. It needs to respect all active filters. When I run my measure it returns (BLANK). I would appreciate any suggestions on...
- 2 years ago
Taxidea_Taxus Try:
_LYSales = VAR CurrentYear = YEAR(MAX('invoicehistory'[invoice date])) RETURN SUMX( FILTER( ALLSELECTED('invoicehistory'), YEAR('invoicehistory'[invoice date]) = CurrentYear - 1 ), [extended price] ) - 2 years ago
I found the following code resolved my measure issue:
_LYSales = VAR CurrentYear = YEAR(MAX('invoicehistory'[invoice date])) RETURN CALCULATE( SUM('invoicehistory'[extended price]), REMOVEFILTERS('InvoiceHistory'[Invoice Date]), YEAR('invoicehistory'[invoice date]) = CurrentYear - 1 )
FreemanZ
Super User
2 years agohi Taxidea_Taxus ,
what filter context do you have for the expected measure? or with which columns are you plotting the measure?
- Taxidea_Taxus2 years ago
Advocate I
- Relative date is set to current year permanently via Filters pane
- Extended price is set to >= $1 permanently via Filters pane