Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Pete_81
Frequent Visitor

Trying to compare the difference between 2 dates recursively?

Hi all

I have a list of dates (from a column called Report Dates) and a list of values (result of COUNTA from a column called "Backlog") in a Matrix visual. 

 compare-dates.JPG

I want to add a new row/Value which shows the difference between the current Report Date and the previous Report Date.

I.e : 

Nov 12th would have +18 next to it as it's an increase of 12 from Nov 5th.

 

How would i go about doing this?

1 ACCEPTED SOLUTION

Hi @Pete_81 

 

try this:

Measure = 
Var _M = Max(table[Report Dates])
Var _M1 = calculate(Max(table[Report Dates]),filter(all(table),table[Report Dates]<_M))
return
COUNTA(table[Backlog]) - calculate(COUNTA(table[Backlog]),filter(all(table),table[Report Dates]=_M1))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

4 REPLIES 4
VahidDM
Super User
Super User

Hi @Pete_81 

 

You can use a measure to add a new column to the matrix to show the variance, Try this measure:

Measure = 
Var _M = Max(table[Report Dates])
Var _M1 = calculate(Max(table[Report Dates]),filter(all(table),table[Report Dates])<_M))
return
COUNTA(table[Backlog]) - calculate(COUNTA(table[Backlog]),filter(all(table),table[Report Dates])=_M1))


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

 

Hi @VahidDM - your example appears to contain 10 opening braces ( but 12 closing braces? )

Have I missed something?

Hi @Pete_81 

 

try this:

Measure = 
Var _M = Max(table[Report Dates])
Var _M1 = calculate(Max(table[Report Dates]),filter(all(table),table[Report Dates]<_M))
return
COUNTA(table[Backlog]) - calculate(COUNTA(table[Backlog]),filter(all(table),table[Report Dates]=_M1))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

That's great, thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.