Forum Discussion
Finding the difference between date values in the same row of different column within a Matrix
- Anonymous2 years ago
Joe_Barry Thanks for your contribution on this thread.
Hi Merle ,
You can create a measure as below to get it, please find the details in the attachment.
WOW = VAR _pcdate = SELECTEDVALUE ( 'Table'[Purchase Complete] ) VAR _category = SELECTEDVALUE ( 'Table'[Category] ) VAR _predate = CALCULATE ( MAX ( 'Table'[Purchase Complete] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category] = _category && 'Table'[Purchase Complete] < _pcdate ) ) VAR _prevalue = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category] = _category && 'Table'[Purchase Complete] = _predate ) ) RETURN DIVIDE ( SUM ( 'Table'[Sales] ) - _prevalue, _prevalue )Best Regards
- 2 years agoThank you very much v-yiruan-msft
Solution works.
Hi Joe,
Thanks for your response. Dax Formula used is giving the same value as the date column not the difference between the column dates of the previous. Is there a different way to format this formula? Thank you.
- Anonymous2 years agoNot applicable
Joe_Barry Thanks for your contribution on this thread.
Hi Merle ,
You can create a measure as below to get it, please find the details in the attachment.
WOW = VAR _pcdate = SELECTEDVALUE ( 'Table'[Purchase Complete] ) VAR _category = SELECTEDVALUE ( 'Table'[Category] ) VAR _predate = CALCULATE ( MAX ( 'Table'[Purchase Complete] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category] = _category && 'Table'[Purchase Complete] < _pcdate ) ) VAR _prevalue = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category] = _category && 'Table'[Purchase Complete] = _predate ) ) RETURN DIVIDE ( SUM ( 'Table'[Sales] ) - _prevalue, _prevalue )Best Regards
- Merle2 years agoFrequent VisitorThank you very much v-yiruan-msft
Solution works.
- Merle2 years agoFrequent Visitor
Hi Anonymous,
Thank you again for your solution to my previous question.
I have encountered an issue in finding the Conversion rate (CR) of two measures between dates. Can you please assist me with this?
CR Formula = Upgrade / Signups
Expected results:
I have tried your dax formula with a slight modification:
This is my result, it is only calculating the first date between Upgrade and Signups.
- Merle2 years agoFrequent Visitor
Found a solution to this.