cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
someuser999 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

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

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

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User
Super User

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

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

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

View solution in original post

someuser999 Frequent Visitor
Frequent Visitor

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

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

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

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

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 156 members 1,562 guests
Please welcome our newest community members: