Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Split a column based on category

Hello!
I just uploaded this question but i didn't label it correctly and I think it got lost in the flow. 

I have a table that looks like this:

 

The price of something will be (one of the "HRR" + one of the "Turn")

The prices are calculated for each alternative via a measure. 

Im thinking something like this:

 

 

 

 

 

Price =
Calculate(
    [Price Measure],
    Filter(
        'Table',
        'Table'[HRR or Turn] = "HRR"
    )
)
+ Calculate(
    [Price Measure],
    Filter(
        'Table',
        'Table'[HRR or Turn] = "Turn"
    )
)

 

 

 

 

 

My question is how do i display this in a table?

I want: 

HRRHRR PriceTurnTurn PriceTotal Price
Ovako12345Leax1234598765

with all alternatives. (2x3)

 


Do you have any suggestions on how I can either change the layout of the data so that it is easily done or how can model my data/measures?

1 Reply

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Anonymous  Where does price measure come from please? You may need to use a CROSSJOIN to get all options or split your data into two unrelated tables - one table for HRR and another table for Turn. Each table should have the Product Code and the option (HRR or TURN). Then you'll relate these to the DimProduct table and you should be able to create a visual using your already existing [Price Measure] (depending on how that's calculated).

     

    Can you paste sample data as a table format (raw data, as separate tables if that's how they come in, and including the price)