Forum Discussion

RanHo's avatar
RanHo
Helper V
4 years ago
Solved

Need help - PowerBi ( Measure base on Classification)

Good day Guys! 

I have a problem here wherein im going to get this Output: 

claim date - file date = SLA DAYS
If the AMOUNT and SLA Days meet the category then it will PASSED otherwise it will mark FAILED.


base on this category/ classification:

 

can someon help me how ? Thanks in Advance.  

  • 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 _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

8 Replies

  • 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 _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • RanHo's avatar
      RanHo
      Helper V

      Nice, your solution works, thanks to you thats a big help!
      And sorry 'bout my error on my example. 

      Many thanks to you!

  • Kumail's avatar
    Kumail
    Impactful Individual

    Hello RanHo 

     

    If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.

     

    Regards

    Kumail Raza

  • Is it possible to do it on Dax

    IF(ESTIMATE RANGE = A AND SLA DAYS =0 and < 1), "PASSED"

     

    ELSE
    (ESTIMATE RANGE = B AND SLA DAYS >2 and <3), "PASSED"

     

    ELSE "FAILED"

    suggestions and advice might help, thanks!



    • Kumail's avatar
      Kumail
      Impactful Individual

      Yes RanHo 

       

      If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.

       

       

      Regards

      Kumail Raza