Forum Discussion
DAX Measure Returns (BLANK)
- 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 )
Taxidea_Taxus Try:
_LYSales =
VAR CurrentYear = YEAR(MAX('invoicehistory'[invoice date]))
RETURN
SUMX(
FILTER(
ALLSELECTED('invoicehistory'),
YEAR('invoicehistory'[invoice date]) = CurrentYear - 1
),
[extended price]
)- Taxidea_Taxus2 years ago
Advocate I
Hello Greg_Deckler , thank you for the resources you directed my to earlier. I have created a .vpax file of this report. You can view it by clicking here. All measures in this report work as intended with one exception...the _LY Sales. It returns the correct answer but does not respect existing filters as the other measures do. No matter what filter options are used, this filter's output remails the same.
- Taxidea_Taxus2 years ago
Advocate I
Thank you for your suggestion. I believe we're getting closer to the solution. The value for this measure changes with each filter selection. Two filter selections return Blank() with the last filter section returning a value. I am wondering if there is a way to return a currency value vs. Blank().