Forum Discussion
Need help - PowerBi ( Measure base on Classification)
- 4 years ago
Hi RanHo ,
In your snapshot above, if the CLASS column is calculated based on the amount compare with Table 2, then the CLASS of FILES NO 800001 should be C, as its amout is above 150K, and its remarks should be failed.
Here's my solution.
Method1
REMARKS = SWITCH ( TRUE (), 'Table'[CLASS] = "A" && 'Table'[SLA DAYS] = 1, "PASSED", 'Table'[CLASS] = "B" && 'Table'[SLA DAYS] IN { 2.3 }, "PASSED", 'Table'[CLASS] = "C" && 'Table'[SLA DAYS] IN { 3, 4, 5 }, "PASSED", "FAILED" )Method2
REMARKS2 = SWITCH ( TRUE (), MAX ( 'Table'[AMOUNT] ) < 50000 && 'Table'[SLA DAYS] = 1, "PASSED", MAX ( 'Table'[AMOUNT] ) >= 50000 && MAX ( 'Table'[AMOUNT] ) <= 150000 && 'Table'[SLA DAYS] IN { 2.3 }, "PASSED", MAX ( 'Table'[AMOUNT] ) > 150000 && 'Table'[SLA DAYS] IN { 3, 4, 5 }, "PASSED", "FAILED" )I attached my sample bellow to help you understand.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RanHo , You can create a new measure
Swirch( True(),
[SLA] =1 && [Amount] < 50000, "A",
[SLA] =1 && [Amount] < 150000, "B",
[SLA] =1 && [Amount] >= 150000, "C",
// Add other conditions
)
You may also need to check binning
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k