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
Anonymous
Not applicable

DAX Help

Hi,

I'm new to DAX and would like some suggestions on how to complete the following;

sample.JPG

Table 1 represents the data as we recieve it from the source.

In our efforts to study the data we need to review the information by comparing Run to Run

Table 2 represents the Table 1 duplicated and filtered to only include Run 1

Table 3 represents the Table 1 duplicated and filtered to only include Run 2

We would like to return Table 4, this table would represent the Run 2 - Run 1 and deliver the data row by row as it relates to the attitude column (as shown above).

 

All help appreciated!!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the help, this is exactly what we were looking for!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Anonymous  - 

You can create a new Measure: 

Change In Attitude = 
var run1 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = 1)
var run2 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = 2)
return run2 - run1

Hope this helps,

Nathan

Anonymous
Not applicable

Thanks for the help!!

 

Is there a way to make the Run selection a slicer?

We some time have several hundred Runs to compare and creating a Measure for each senario will be quite a challange.

Anonymous
Not applicable

Yes, if you select 2 runs, you could do it like the following:

Change In Attitude = 
var firstrun = min('Table 1'[Run])
var secondrun = max('Table 1'[Run]) var run1 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = firstrun) var run2 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = secondrun) return run2 - run1

 

Anonymous
Not applicable

Thanks for the help, this is exactly what we were looking for!!

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.