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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
someuser999
New Member

Dax question about comparing non-adjacent row values in same column

Comparing row values. In Dax, for each subject and test item, how to determine the difference (numeric) between the type 3 result and the type 1 result?

Subject Tester TestType TestItem1 TestItem2 TestItem3
Subject 1 Tester 1 Type 1 Result 1 Result 1 Result 1
Subject 1 Tester 1 Type 2 Result 2 Result 2 Result 2
Subject 1 Tester 2 Type 3 Result 3 Result 3 Result 3
Subject 2 Tester 1 Type 1 Result 1 Result 1 Result 1
Subject 2 Tester 3 Type 3 Result 2 Result 2 Result 2


1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,
wondering if you considered to use
LOOKUPVALUE 

https://msdn.microsoft.com/en-us/query-bi/dax/lookupvalue-function-dax

in combination with unpivoting the columns TestItem1 ... TestItem3

 

 

If this is not what you are looking for, please consider to create a pbix file that contains sample data, upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,
wondering if you considered to use
LOOKUPVALUE 

https://msdn.microsoft.com/en-us/query-bi/dax/lookupvalue-function-dax

in combination with unpivoting the columns TestItem1 ... TestItem3

 

 

If this is not what you are looking for, please consider to create a pbix file that contains sample data, upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Looks like that could work. Could it be done without hard coding all the search column values?

Hey,

 

basically you can use variables that reduces hardcoding dramtically, also consider to pivot the columns Testresult1 - Testresult3 into one column

 

Everything gets much more simple if you provid a pbix with sample data, upload the file to onedrive or dropbox and share the link.

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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