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
Delion
Helper IV
Helper IV

Combine two city into one

Delion_1-1673498353000.png

 

Hi I need help to combine "NY" and "New York" as New York in dasboard.

My connection is live connection

I tried to use grouping and binning but can't find this feature , is it because I'm using live connection ?

 

Thank

 

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @Delion 

You can create a measure

e.g 

Values = var a=ADDCOLUMNS(ALLSELECTED('Table (2)'),"Combine",SUBSTITUTE([Table],"NY","New York"))
return IF(ISFILTERED('Table'[City])=FALSE(),SUM('Table (2)'[Value]),IF(MAX('Table'[City]) in {"NY","New York"}&&MAX('Table (2)'[Table])="New York",SUMX(FILTER(a,[Combine]="New York"),[Value])))

Output:

vxinruzhumsft_0-1673598694130.png

 

vxinruzhumsft_1-1673598704351.png

 

Best Regards!

Yolo Zhu

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

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I assume there is a relationship between a master table and a fact table.

Please try something like below whether it suits your requirement.

 

expected result measure: =
IF (
    SELECTEDVALUE ( 'Master table'[City] ) = "New York",
    CALCULATE (
        SUM ( 'Fact table'[Value] ),
        'Master table'[City] IN { "New York", "NY" }
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.