Forum Discussion
thinker_02
2 years agoRegular Visitor
Previous Status Measure
The "Profit" table has columns Product ID, Date, and Status, with Status categorized as High, Low, or Medium. Snapshot of the Profit table: | Product ID | Date | Status | |------------|-------...
- Anonymous2 years ago
Hi thinker_02 ,
Here are the steps you can follow:
1. Create measure.
Flag = var _date= MAXX( FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date]) return IF( MAX('Table'[Date])=_date,1,0)Second Date = var _date= MAXX( FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date]) return MAXX( FILTER(ALL('Table'), 'Table'[Product ID]=MAX('Table'[Product ID])&&'Table'[Date]<_date),[Date])Status Latest = var _date= MAXX( FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date]) var _maxdate= MAXX( FILTER(ALL('Table'), 'Table'[Product ID]=MAX('Table'[Product ID])&&'Table'[Date]<_date),[Date]) return MAXX( FILTER(ALL('Table'), 'Table'[Product ID]=MAX('Table'[Product ID])&& 'Table'[Date] =_maxdate),[Status])2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
2 years agoNot applicable
Hi thinker_02 ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _date=
MAXX(
FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date])
return
IF(
MAX('Table'[Date])=_date,1,0)Second Date =
var _date=
MAXX(
FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date])
return
MAXX(
FILTER(ALL('Table'),
'Table'[Product ID]=MAX('Table'[Product ID])&&'Table'[Date]<_date),[Date])Status Latest =
var _date=
MAXX(
FILTER(ALLSELECTED('Table'),'Table'[Product ID]=MAX('Table'[Product ID])),[Date])
var _maxdate=
MAXX(
FILTER(ALL('Table'),
'Table'[Product ID]=MAX('Table'[Product ID])&&'Table'[Date]<_date),[Date])
return
MAXX(
FILTER(ALL('Table'),
'Table'[Product ID]=MAX('Table'[Product ID])&& 'Table'[Date] =_maxdate),[Status])
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly