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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Zakaria_1980
Post Patron
Post Patron

need support

Dears,

 

i've a table with multiple Cities which are not sorted and next to each city some versions . i would like to add another column where whenever the version is the highest one in that city, he will put 1 and for others he will put 0.

 

tbl will looks like this:

 

CityVersion
City1TGF V1.0
City1TGF V6.0
City1TGF V3.0
City2TGF V1.0
City2TGF V1.0
City2 
City2 TGF V4.0
City3 TGF V2.0
City5 TGF V1.0
1 ACCEPTED SOLUTION

@Zakaria_1980 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@Zakaria_1980 

maybe you can try to create two columns.

Column = 
var v=right('Table'[Version],3)
return if(v="",0,int(v))

Column 2 = 
VAR _max=CALCULATE(max('Table'[Column]),ALLEXCEPT('Table','Table'[City]))
return if('Table'[Column]=_max,1,0)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This is what i'm getting as error, could you help me please

 

 

Zakaria_1980_0-1628069624752.png

 

@Zakaria_1980 

maybe try 

Column 2 = 
VAR _max=CALCULATE(max(sheet1(var v]),ALLEXCEPT('sheet1','sheet1'[project name]))
return if('sheet1'[var v]=_max,1,0)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




i tried it but it doesn't work. could you apply it in your laptop and share with me the correct dormula to put please.

thanks in advance

@Zakaria_1980 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.