Forum Discussion
Power BI - way to count rows based on conditional formatting
- 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.
It is feasible, pls provide tables
Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.
Need help uploading data? click here
Want faster answers? click here
- Flossiebug1 year agoNew Member
Hi - thanks for your answer - I will include more info next time as an example, making sure to keep it anonymised.