Hello,
I am trying to understand why one measure works and another does not. I have a simple model with a Sales Table (Adventureworks) and a Dates table. The Adventureworks Sales table does not have sales on every date but rather only on a few selected dates. And I want to calculate cumulative sales and only display dates with sales. I found a measure on this board that works and I have pasted it below, however I thought another measure would also work and it does not. So my question is, why is the 2nd measure not working? Thanks!
This measure from Sam worksā¦
Cumulative Sales allselected dates table remove blanks =
var CumulativeSales = CALCULATE([Sales],
FILTER(ALLSELECTED(āDatesā),
āDatesā[Date] <= MAX(āDatesā[Date])
)
)
RETURN
IF(ISBLANK([Sales]),BLANK(),CumulativeSales)
in this Measure, I used a table filter on the Sales table but when I do this, the cumulative part of the measure does not work. I guess the āSales Ordersā table filter is overriding the Dates filter above? Is there another way to apply this filter? Is the If(ISBLANK() solution above the only way to tackle this?
Cumulative Sales allselected dates table with Sales Table Filter =
CALCULATE([Sales],
FILTER(ALLSELECTED(āDatesā),
āDatesā[Date] <= MAX(āDatesā[Date])
),
āSales Ordersā
)
Here is the result of the two measuresā¦
Thanks!!