Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Team,
How can I filter the entire dataset based on a specific status?
Name | Status | Date |
ABC1 | S1 | 1/15/2018 |
ABC1 | S2 | 2/1/2018 |
ABC1 | S3 | 2/5/2018 |
ABC1 | S5 | 4/2/2018 |
ABC2 | S1 | 2/3/2018 |
ABC2 | S2 | 3/19/2018 |
ABC2 | S3 | 4/23/2018 |
ABC2 | S4 | 4/29/2018 |
ABC2 | S5 | 5/3/2018 |
ABC3 | S1 | 4/4/2018 |
In this case, I want to filter out all the individuals who have the status of "S3". So COUNTROWS in the above example will be 1 as ABC1 and ABC2 will get filtered out because they have status of S3. How can I write a measure for this?
@Anonymous I think I solved something similar a few weeks ago too, but here is the approach I would try this combination of measures:
Names = distinctcount(Table[Name])
Names Excluding S3 = [Names] - calculate([Names],Table[Status] = "S3")
This will give you a count of distinct names, and then in the second one it takes that total and then removes those that may have that S3 status. If you want to use this in conjunction with a Status slicer (so you pick only those with status S2 and you sitll want to exlude those with an S3 status) then you would need to alter the measure a bit, I think like this, but I'll verify:
Names Excluding S3 = [Names] - calculate([Names],filter(all(Table),Table[Status] = "S3"))
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@Anonymous , Try like
countx(filter(summarize(table, table[name], "_1", calculate(countrows(Table),Table[Status] ="S3" )),[_1]>=1),[name])
removing after aggregation
@Anonymous add following measure
Count = CALCULATE ( COUNTROWS( Table ), Table[Status] = "S3" )
or
Count Records = COUNTROWS ( Table )
the first measure will filter for s3, or you can add a slicer for status and use 2nd measure, it will filter based on the selected slicer.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |