cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Finding the difference between date values in the same row of different column within a Matrix

Hi,

I will greatly appreciate help in finding the difference between dates values within a matrix inorder to determine WoW%.

Desired out put in screen shot below.

This visual was obtain using the new tool New Calculation(fx) but has limitation of not being able to export data with these calculations.

These are the calculation used.

Versus previous = [Purchase Complete] - PREVIOUS([Purchase Complete], COLUMNS).
WOW = FORMAT(DIVIDE([Versus previous], PREVIOUS([Purchase Complete],COLUMNS),0),"#,#0%").

2 ACCEPTED SOLUTIONS
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor

Thank you very much v-yiruan-msft

## Solution works.

7 REPLIES 7
Frequent Visitor

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.

Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor

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.

Frequent Visitor

Found a Solution to this

Frequent Visitor

Found a solution to this.

Frequent Visitor

Thank you very much v-yiruan-msft

## Solution works.

Super User

Hi @Merle

Thanks

Joe

Proud to be a Super User!

Learn about the Star Schema, it will solve many issues in Power BI!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.