Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Filtering the entire group

Hi Team,

 

How can I filter the entire dataset based on a specific status?

NameStatusDate
ABC1S11/15/2018
ABC1S22/1/2018
ABC1S32/5/2018
ABC1S54/2/2018
ABC2S12/3/2018
ABC2S23/19/2018
ABC2S34/23/2018
ABC2S44/29/2018
ABC2S55/3/2018
ABC3S14/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?

3 REPLIES 3
DataZoe
Employee
Employee

@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/

amitchandak
Super User
Super User

@Anonymous , Try like

countx(filter(summarize(table, table[name], "_1", calculate(countrows(Table),Table[Status] ="S3" )),[_1]>=1),[name])

 

removing after aggregation

parry2k
Super User
Super User

@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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.