Forum Discussion

Flossiebug's avatar
Flossiebug
New Member
1 year ago
Solved

Power BI - way to count rows based on conditional formatting

Hi all - I'm currently trying to develop a simple dashboard for use at work in my NHS department.    I have a table of reasons for cancellations - so it's free text format. I've applied conditional...
  • mdaatifraza5556's avatar
    1 year ago

    Hi Flossiebug 


    As per my understanding of you requirement i have tried using below dax.

    1. Create a calculated column using below dax ( If you want to add some more condition then you can in to that).

    CancellationCategory =
    SWITCH(TRUE(),
        SEARCH("ill", 'Table'[Reason], 1, 0) > 0, "Illness",
        SEARCH("medication", 'Table'[Reason], 1, 0) > 0, "Medication Issue",
        "Other"
    )
     

     

    2. Create measure and then add that measure into the card and the calculated column use it as a slicer.
    ------> Use below dax to create dax which calculate as per the slicer.

     

    Count =
    COUNTROWS('Table')


     

     


    If this answers your questions, kindly accept it as a solution and give kudos.