Forum Discussion
Help with ABC Customer categorizing - DAX
- 1 year ago
Slightly confused what you're expecting (please explain) - this is the result I get when I add your existing measure with the new measure I made:
If you can see there's multiple values being returned in the table and you only want one based on precedence, then you'd need to do an if or switch condition in the Result variable. e.g. If category A exists, then take value A, if Category B exists then take value B, etc...
Hello, the issue here is that the columns are A,B,C And the Measure is bringing the profitability, I can't do a switch case...
- pbiuseruk1 year agoResolver IV
It's hard for me to visualise this but if you share a PBIX file with some dummy data in there, I can take a look.
- Okazakipedro1 year agoHelper I
Absolutely, attached a sample file:
https://drive.google.com/file/d/1J_XdL6Zi1Z5x0aqBIr54lYvuUrX32Xpg/view?usp=sharing- pbiuseruk1 year agoResolver IV
Could you try using this:
NewMeasure = Var ControllingCustomerCode = SELECTEDVALUE(SampleData[Controlling Customer Code]) RETURN CALCULATE(LASTNONBLANK ( Support_Category[Category], 1 ), FILTER ( Support_Category, [measure_job_totalProfitEur] > 'Support_Category'[ProfitLowerBoundaries] && [measure_job_totalProfitEur] <= 'Support_Category'[ProfitUpperBoundaries] || ( [measure_job_totalRevenueEur] > 'Support_Category'[RevenueLowerBoundaries] && [measure_job_totalRevenueEur] <= 'Support_Category'[RevenueUpperBoundaries] ) ), SampleData[Controlling Customer Code] = ControllingCustomerCode )Then make a table with the company code, the measure for the euro amount and this new measure.
Please let me know if this is what you were after?