Forum Discussion
return value (text format) for previous qtr
- Anonymous1 year ago
Hi Marshmallow ,
Please try this way:
First use this DAX to create a calculated column:RANK = VAR _Region = [Region] VAR _Company = [Company] VAR _Type = [Type] RETURN RANKX( FILTER( ALL('Table'), 'Table'[Region] = _Region && 'Table'[Company] = _Company && 'Table'[Type] = _Type ), 'Table'[Period], , DESC, Dense )Then use this DAX to create another calculated column:
Previous Qtr = VAR _Region = [Region] VAR _Company = [Company] VAR _Type = [Type] VAR _Rank = [RANK] RETURN CALCULATE( MAX('Table'[Rating]), ALL('Table'), 'Table'[Region] = _Region && 'Table'[Company] = _Company && 'Table'[Type] = _Type && 'Table'[RANK] = _Rank + 1 )And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Marshmallow , I would prefer to create date using period
Date = datevalue("01-" &[Period])
I can join this date with date of date table and use time intelligence
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
- Marshmallow1 year agoHelper II
can you please create it in the power bi and send the file so i can follow it through? i have issue creating the date too