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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
danidelriego
Regular Visitor

How to represent 2 values after a max of a third

Hi all,

 

First of all, I must admit that I am a total noob in Power BI, so sorry if this is simple, but I just can't figure it out.

I am working on project in which I need to represent the value of 2 columns when the value of a third column (the multiplication of the other 2) is maximum.

Column AColumn BColumn C (multiplication)
5210
4312
144

 

So, in this case, I need to represent the second row (A=4 & B=3), as Column C reaches its highest value. However, when I try to plot A and B in a scatter graph, I can only choose maximum values for A and B, so it is totally wrong (A=5 & B=4).

 

I tried to figure out ways to filter by maximum value of Column C, but I can't find a solution.

 

Thank you in advance!

 

1 ACCEPTED SOLUTION
Aburar_123
Resolver IV
Resolver IV

Hi @danidelriego ,

You can achieve like this,

Create below 2 calculated columns,

 

Max C = CALCULATE(MAX('Table'[Column C (multiplication)]),FILTER('Table','Table'[Location]=EARLIER('Table'[Location])))
 
Applicable Flag = IF('Table'[Column C (multiplication)]='Table'[Max C],1,0)
 

 

Aburar_123_0-1695210689873.png

then apply the filter as below

Aburar_123_2-1695210997659.png

 

 

Please accept it as your solution if it answer your post. Thanks.

View solution in original post

3 REPLIES 3
Aburar_123
Resolver IV
Resolver IV

Hi @danidelriego ,

You can achieve like this,

Create below 2 calculated columns,

 

Max C = CALCULATE(MAX('Table'[Column C (multiplication)]),FILTER('Table','Table'[Location]=EARLIER('Table'[Location])))
 
Applicable Flag = IF('Table'[Column C (multiplication)]='Table'[Max C],1,0)
 

 

Aburar_123_0-1695210689873.png

then apply the filter as below

Aburar_123_2-1695210997659.png

 

 

Please accept it as your solution if it answer your post. Thanks.

123abc
Community Champion
Community Champion

You can achieve this in Power BI by creating a calculated table that includes only the rows where Column C (the multiplication result) is at its maximum value and then using this calculated table for your scatter plot. Here's how you can do it:

  1. Create a Calculated Table for Maximum Values:

    Go to the "Model" view in Power BI, then click on "New Table" in the "Modeling" tab. In the formula bar, enter the following DAX formula to create a calculated table:

MaxValuesTable =

SUMMARIZE (

     YourTable, // Replace YourTable with the name of your original table

      YourTable[Column A],

      YourTable[Column B],

      YourTable[Column C],

      "MaxValue", MAX(YourTable[Column C])

)

 

  1. This formula creates a new table, "MaxValuesTable," that contains all the columns from your original table (Column A, Column B, and Column C) along with an additional column called "MaxValue," which stores the maximum value from Column C.

  2. Create a Scatter Plot Visualization:

    Now, go back to the "Data" view or "Report" view in Power BI, and insert a scatter plot visualization. In the "Values" section of the scatter plot, drag "Column A" to the "X-axis" and "Column B" to the "Y-axis."

  3. Apply Filters:

    In the "Visualizations" pane, select "MaxValuesTable" as your data source for the scatter plot.

  4. Add a Tooltip:

    If you want to see the details of each point, you can add a tooltip to the scatter plot. In the "Fields" section of the "Visualizations" pane, add "Column A" and "Column B" to the tooltip field well.

Now, your scatter plot will show only the points corresponding to the rows where Column C has its maximum value, which is what you were looking for.

 

 

Thank you very much for your response.

Now I have another issue. I have another column called 'location', and I would like to group by location in a way that, for each location, I get the maximum value of C and the values of A & B that calculates C.

I have tried to use your code with modifications I found in the internet, but I can't aggregate the table.

Thank you again in advance and sorry for making the topic bigger.

 

Sample data:

LocationColumn AColumn BColumn C (multiplication)

Spain

5210
Spain4312
Spain144
France122

France

313
France111

 

Expected result of aggregation:

LocationColumn AColumn BColumn C (multiplication)
Spain4312
France313

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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