Forum Discussion
Anonymous
5 years agoNot applicable
Most Recent Transaction Per Store
The goal is to flag only the most recent transaction per store. My current output will flag the most recent transaction for each unique transaction. The requirements changed and I need to flag only t...
- 5 years ago
Measure 2 = IF ( CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( VALUES ( 'Table'[Date] ), 'Table'[Date] = CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[store])) ) ) <> BLANK (), "latest" )
smpa01
5 years agoCommunity Champion
Anonymouscan you try this measure
Measure :=
IF (
CALCULATE (
MAX ( 'Table 1'[Date] ),
FILTER (
VALUES ( 'Table 1'[Date] ),
'Table 1'[Date] = CALCULATE ( MAX ( 'Table 1'[Date] ), ALL ( 'Table 1' ) )
)
)
<> BLANK (),
"latest"
)
- Anonymous5 years agoNot applicable
smpa01 Thank you so much for your support! This is pretty much spot on for what I am looking for. Question for you though. If I wanted to do this same action but apply it to every store, how would you update this measure? My sample data only reflected 1 store. Let's assume that there are 5,000 stores and you wanted to reflect the most recent transaction for each store. How would you update this measure? The output when I dropped your suggestion into my model gave me the most recent transaction but only reflected 1 store when the goal is to reflect the most recent transaction for all stores.
Ex: 5,000 stores = 5,000 most recent transactions output
- smpa015 years agoCommunity Champion
Measure 2 = IF ( CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( VALUES ( 'Table'[Date] ), 'Table'[Date] = CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[store])) ) ) <> BLANK (), "latest" )