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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vikki
Frequent Visitor

Calculate Max value in a table visual

Hi Everyone,

 

I am trying to write a DAX measure to calculate Max value in a table visual. Please refer to the image below:

Vikki_0-1637164946303.png

I created a 3-column table visual, column 1 and 3 are dragged from 'AD' table, column 3 [% on Site] is a measure.

Column 2 [Date] is dragged from 'All Entries' table.

I try to calculate Max % on site of each Branch. The result should look like this:

USS  54.55%

CFM  27.58%

DMA 27.27%

...

 

Could someone help me with the DAX expression?

Thank you,

Vikki

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Vikki ,

Is there any relationship created between table AD and All Entries? Could you please provide some sample data in table All Entries? From your screenshot, it looks like there are multiple dates for each branch, do you want the final result to get the [% on Site] of the latest date for each branch? For example, Branch: USS only shows Date Sep 17, will the final result be what is circled in red in the table below?

Expected result??Expected result??

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft @amitchandak ,

 

Thank you for looking into this. 

One of the other problem I am facing is there is many to many relationship between AD table and All Entries table, through people's names, which is not a reliable key. But for now, the client didn't provide anything else.

Vikki_0-1637587571116.png

I wonder if this is not acheivable unless I have a unique key and 1 to many relationship between AD and All Entries table.

Thanks anyway,

Vikki

aj1973
Community Champion
Community Champion

Hi @Vikki 

Add a new Table containing distinct values from column Name then link all three together. However this won't solve the view in your Table Visual unless you take only the Max Date from every Branch.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

amitchandak
Super User
Super User

@Vikki , Try a new measure like

 


var _max = calculate(MaxX(summarize(Table, Table[Branch], Table[site], "_1",[Max %]), [_1]), filter(allselected(Table), Table[Branch] = max(Table[Branch]) && Table[site] = max(Table[site])))
return
if( [Max %] = _max, [Max %], blank())

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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