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

MAX VALUE IN A ROW

Hi,

am new to PBI and PQ,  request your help regarding how to add a new column by finding  max value in a row.  table format details are attached herewith. am looking to add a column which will give the maximum collection of a busnumber by comparing collecitons on Sunday, Monday and Tuesday .

for eg: KNR01 maximum collection is on Monday so in the new column i want to show value of Monday

dsmitha_0-1648221660726.png

 

 

 

4 ACCEPTED SOLUTIONS
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! To get your desire result, I would recommend the following:

1. Go to PQ, and select your "busnumber" and "SEATINGCAPACITY" columns and unpivot the other columns. You then get a "Attribute" and a "Value" column where your Attribute becomes the "Day" and the Value becomes the seatings (I suppose)

2. Close and Apply PQ

3. Add the following measure 

Max Value =
CALCULATE (
    SELECTEDVALUE ( Table[busnumber] ),
    FILTER ( Table, [Value] = MAX ( Table[Value] ) )
)

4. Add the measure to your table visual and check the results.

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

View solution in original post

Vijay_A_Verma
Super User
Super User

You can use following formula to get Max in PQ

=List.Max({[Sunday],[Monday],[Tuesday]})

 

View solution in original post

Anonymous
Not applicable

Hi Vijay,

 

Thanks a lot

 

👍

View solution in original post

Anonymous
Not applicable

Hi Goncalogeraldes,

 

Thank you so much 

👍

 

View solution in original post

7 REPLIES 7
Vijay_A_Verma
Super User
Super User

You can use following formula to get Max in PQ

=List.Max({[Sunday],[Monday],[Tuesday]})

 

Anonymous
Not applicable

Hi Vijay,

i would like to get the result as max value + the day

for eg: 6100 -> Monday

kindly advise

 

Anonymous
Not applicable

Hi Vijay,

 

Thanks a lot

 

👍

goncalogeraldes
Super User
Super User

Hello there @Anonymous ! To get your desire result, I would recommend the following:

1. Go to PQ, and select your "busnumber" and "SEATINGCAPACITY" columns and unpivot the other columns. You then get a "Attribute" and a "Value" column where your Attribute becomes the "Day" and the Value becomes the seatings (I suppose)

2. Close and Apply PQ

3. Add the following measure 

Max Value =
CALCULATE (
    SELECTEDVALUE ( Table[busnumber] ),
    FILTER ( Table, [Value] = MAX ( Table[Value] ) )
)

4. Add the measure to your table visual and check the results.

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

@goncalogeraldes @Anonymous @Vijay_A_Verma How to print the max # of that row in this case? For example: For KNR001, The max of value of Sunday, Monday, Tuesday is 6100. How can the result be 6100?

Anonymous
Not applicable

Hi goncalogeraldes,

i would like to get the result as max value + the day

for eg: 6100 -> Monday

kindly advise

Anonymous
Not applicable

Hi Goncalogeraldes,

 

Thank you so much 

👍

 

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.

Top Solution Authors