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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
chotu27
Post Patron
Post Patron

Compare with previous visit and calculate it in Matrix visual

Hi Everyone,

 

In below picture i wanted to compare it with prevous visit and calculate it.

 

Can i know the DAX calculation for it please

 

Example : For ID 1001 Visit2- Visit1 = 22-23 = -1.

 

 

Pre visit.PNG

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

HI @chotu27

 

I had some luck with this calculated column and have attached a PBIX file at the bottom.

 

Column = 
VAR VisitNumber = INT(MID('Table1'[Memory],7,99))
VAR LastValue = MAXX(FilTER('Table1','Table1'[Memory] = "Visit " & VisitNumber-1 && 'Table1'[ID] = EARLIER('Table1'[ID])),'Table1'[Value])
RETURN IF(NOT ISBLANK(LastValue),'Table1'[Value] - LastValue) 

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Phil_Seamark
Employee
Employee

HI @chotu27

 

I had some luck with this calculated column and have attached a PBIX file at the bottom.

 

Column = 
VAR VisitNumber = INT(MID('Table1'[Memory],7,99))
VAR LastValue = MAXX(FilTER('Table1','Table1'[Memory] = "Visit " & VisitNumber-1 && 'Table1'[ID] = EARLIER('Table1'[ID])),'Table1'[Value])
RETURN IF(NOT ISBLANK(LastValue),'Table1'[Value] - LastValue) 

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.