Forum Discussion
How to split two values inside one column into two different measures?
- 6 years ago
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]
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]))
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.
- amitchandak6 years agoSuper User
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]
- Gjakova6 years agoPost Patron
Thank you, that's it.