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
Gjakova
Post Patron
Post Patron

How to split two values inside one column into two different measures?

Does someone know how I can split a measure just using DAX? I have a measure from my database with two values (value A and B), I want to create two seperate measures from that single measure. Measue A and Measure B, does someone know how to do this in DAX?

Example: measure X contains the values ABC and XYZ
I want to calculate the revenue for value ABC and XYZ and then also calculate the difference between them. Therefore I need ABC and XYZ in two seperate measures.

Anybody with a suggestion for this problem?

 

P.s. I'm working with a live connection, so I can't make changes into my database.

1 ACCEPTED SOLUTION

@Gjakova , measure like ?

New York= calculate(sum(Table[revenue]),filter(table,table[city]="New York"))
Los Angeles= calculate(sum(Table[revenue]),filter(table,table[city]="Los Angeles"))

diff = [New York] - [Los Angeles]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Gjakova , what do mean by split here

there are so many functions to deal with text

https://docs.microsoft.com/en-us/dax/text-functions-dax

 

It needs to done on row context like

 

countx(table, if(left(Table[col],2) ="AB",Table[Val1],Table[Val2]))

sumx(table, if(left(Table[col],2) ="AB",Table[Val1],Table[Val2]))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak thank you for your reply.

I think that measure is incorrect (?)

What I mean is this, I have a column that shows the following:

City
New York
Los Angeles

 

And I have another column with revenue.

I want to create a measure which calculates all the revenue from New York and another measure which calculates the revenue from Los Angeles.

Furthermore, I would like to show the difference in revenue between New York and Los Angeles. But for that I could just use the measure of New York minus the measure of Los Angeles.

But I can't get the first two measures to work, but in my mind I think it should be very simple, but I can't figure it out why it does not work.

@Gjakova , measure like ?

New York= calculate(sum(Table[revenue]),filter(table,table[city]="New York"))
Los Angeles= calculate(sum(Table[revenue]),filter(table,table[city]="Los Angeles"))

diff = [New York] - [Los Angeles]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, that's it.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.