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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Atiroocky
Frequent Visitor

Calculated table of MIN value

Hello,

 

To get my data easier to plot on scatter visual, I have unpivoted my data source.

 

Original

 

  z1z2z3
x1y1V1V4V7
x2y2V2V5V8
x3y3V3V6V9

 

Unpivoted

 

XYValue
x1y1z1V1
x2y2z1V2
x3y3z1V3
x1y1z2V4
x2y2z2V5
x3y3z2V6
x1y1z3V7
x2y2z3V8
x3y3z3V9

 

I use as scatter plot in which I want to visualize the min value of each couple of (xi ; yi).

I works, but values are overlapping. The top of the pile is the "min value" as well. It’s ok but I can see the color of the other values behind.

It’s a bit unsightly, so I would like to calculate a table which will only contain the min value, and directly scatter plot from it.

 

I would like to get a table like this from the unpivoted table

 

XYCalculated min valueReturn z
x1y1min Valuez ?
x2y2min Valuez ?
x3y3min valuez ?

 

How can I do it with DAX ?

 

Thanx

3 REPLIES 3
Ajendra
Resolver I
Resolver I

Hey,

 

I hope you are doing well!

 

Try this one!

 

1.JPG

 

Used data as shown below screen shot:

2.JPG

johnt75
Super User
Super User

Firstly you need to make sure that your underlying data table has at least one column which can uniquely identify a row. You can use Power Query to add an index column. You then need to go into the Model view, select the data table and mark the index column as the key column.

You can then create a summary table like

Summary Table = INDEX(
	1,
	'Table',
	ORDERBY( 'Table'[Value], DESC, 'Table'[Index], DESC),
	PARTITIONBY( 'Table'[X], 'Table'[Y])
)

Thanks for your reply.

I’ve done exactly what you mentionned :

- create index column with PowerQuery

- set index column as key column in data Model tab

- rewrite your code to match my table/column names.

 

The result table has the good shape. I mean, I only have single couple of (xi,yi).
But the value returned is NOT the MIN of (xi, yi) among  z1, z2 and z3

 

EDIT :

I managed to get what I wanted thanks to EARLIER function.



 

Min_Value = CALCULATE(
MIN(Table1[Value]),
FILTER(Table1,((Table1[X]=EARLIER(Table1[X]))*(Table1[Y]=EARLIER(Table1[Y]]))
))

 

Then I add a new "true/false" column which returns "true" if Value = Min_Value

 

XYValueMin_ValueTest
x1y1z1V1V4false
x2y2z1V2V2true
x3y3z1V3V9false
x1y1z2V4V4true
x2y2z2V5V2false
x3y3z2V6V9false
x1y1z3V7V4false
x2y2z3V8V2false
x3y3z3V9V9

true

 

Then I created a new table with filter of "true" values

 

XYZ

Min_Value

x2y2z1V2
x1y1z2V4
x3y3z3

V9

 

If you have an easiest way to procede, I catch !

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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