cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper V

## Maximum value of a column filtered by other columns

Hi,

I have a table with these values and I need to filter the values with the example table (future), the result is column C

Actual:

Future:

Thanks!!

Xavi.

1 ACCEPTED SOLUTION
Helper V
10 REPLIES 10
Super User

@XaviOV , a new column like

new column =
var _1 = countx(filter(Table, [ID_1] =earlier[ID_1] && [B] =0),[ID_1])+0
var _2 = MinX(filter(Table, [ID_1] =earlier[ID_1] ),[ID_0])
return
if([ID0] =_2 ,if(_1>0 0, 1),blank())

Helper V

Hi @amitchandak  ,

When I write the formula appear an error, I think that function earlier need something, it's possible?

Regards,

Xavi

Super User

@XaviOV , My mistake missing paranthesis

new column =
var _1 = countx(filter(Table, Table[ID_1] =earlier(Table[ID_1]) && [B] =0),[ID_1])+0
var _2 = MinX(filter(Table, [ID_1] =earlier(Table[ID_1]) ),[ID_0])
return
if([ID0] =_2 ,if(_1>0 0, 1),blank())

Helper V

Hi @amitchandak

I applied the formula that you write and this is the result, in this case in the file with the number of ID0 471635 and the row of new column should appear number 0

Regards,

Xavi

Helper V

Hi @amitchandak

In the second IF beacause there are two 0?

Thanks!!

Xavi

Super User

@XaviOV ,Can you share sample data and sample output in table format?

Helper V

Hi @amitchandak

ID0 is Whole number
ID1 is Text
A is Text
B is Whole number

Regards,

Xavi

Helper V

Hi @amitchandak

I try to paste the table from Excel but appear a error.

Regards,

Xavi

Helper V
Super User

@XaviOV , Hope you got the solution on that blog. Thanks for sharing.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors