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
michael95677
Helper III
Helper III

How to filter report using measure or distinct count formula on column

I am fairly new to Power BI and loaded a query to build various reports from. The query loaded fine. However, I'm trying to filter the table by only showing rows based on a count of < 3 on a column included in the query/table. I've tried a measure using Calculate and distinctcount but always get errors: 

Measure = ActionsItemsCount

CALCULATE(

DISTINCTCOUNT('Referrals'[seq_no]),

FILTER('Referrals'[seq_no] < 3))
 
I've also tried adding a data field as a column using 
CountActionItems = distinctcount(Referrals[seq_no]) < 3
and this seems to work but I do not know how to use it as a filter in the report. Any help is greatly appreciated. 
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try the below.

 

ActionsItemsCount =
CALCULATE (
DISTINCTCOUNT ( 'Referrals'[seq_no] ),
FILTER ( 'Referrals', 'Referrals'[seq_no] < 3 )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please try the below.

 

ActionsItemsCount =
CALCULATE (
DISTINCTCOUNT ( 'Referrals'[seq_no] ),
FILTER ( 'Referrals', 'Referrals'[seq_no] < 3 )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Ahhh, I forgot the second table reference. Thank you so much. Now if I could just figure out how to actually apply this measure to the report output that would be great. 

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.