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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pluto556
Frequent Visitor

How do I find the percentage of a filtered column out of an unfiltered column by its group

Hi, 

 

I have a pretty large dataset that looks like the one on the left:

 

Screen Shot 2020-09-08 at 10.53.30 PM.png

I need to filter out where Condition is less than or equal to 5, then group by Group and count the rows after the filter and keep track of the total count in each group without the filter. Then I need to find the filtered count percentage of the unfiltered count by each group. The table and chart on the right are what I'm trying to achieve. 

 

I'm pretty new to Power B.I., any ideas on how I can acheive this?

 

Thanks! 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

My first chart in PBI (I don't know how to change scale and colors) but I hope it is useful for your purpose

 

per scaricarli, fai click sul seguente link e segui le istruzioni.

https://giga.allegati.tim.it/r?d=alice.it&wr=rocco.lupoi@telecomitalia.it&ws=sprmnt21&e=alice.it&c=j...

 

image.png

 

View solution in original post

v-xuding-msft
Community Support
Community Support

Hi @pluto556 ,

 

If you want to implement it with DAX, please try like this:

 

All of the formulas are measures:

Counts of Qty after filter = CALCULATE(SUM('Table'[Qty]),'Table'[Condition]<=5)
Total counts = COUNTROWS('Table')
Pct = DIVIDE([Counts of Qty after filter],[Total counts])

 9.PNG

 

 

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

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @pluto556 ,

 

If you want to implement it with DAX, please try like this:

 

All of the formulas are measures:

Counts of Qty after filter = CALCULATE(SUM('Table'[Qty]),'Table'[Condition]<=5)
Total counts = COUNTROWS('Table')
Pct = DIVIDE([Counts of Qty after filter],[Total counts])

 9.PNG

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

My first chart in PBI (I don't know how to change scale and colors) but I hope it is useful for your purpose

 

per scaricarli, fai click sul seguente link e segui le istruzioni.

https://giga.allegati.tim.it/r?d=alice.it&wr=rocco.lupoi@telecomitalia.it&ws=sprmnt21&e=alice.it&c=j...

 

image.png

 

Greg_Deckler
Super User
Super User

@pluto556 - Well to ignore stuff, use ALL or ALLEXCEPT. So maybe something like:

Measure =
  VAR __Count = COUNTROWS('Table')
  VAR __CountAll = COUNTROWS(ALL('Table'))
RETURN
  DIVIDE(__Count,__CountAll)

Also, don't forget about Show value as, Percent of Grand Total. Handy. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors