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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to get count based on the the filter selected.

Hi Guys,

 

Can you please help me how i will get the count based on the filter selected. I have month data like 1,2,3,4,5
if i select all it should give me result as "5" else based on the numbers of month selected it should give. 

 

If in filter, i have selected 1,4,5 then i am expecting result as 3. Please help me how i can achieve this based on the filter selection it should get me the result.  

 

Thanks.

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , simple count should work in that case

COUNT('Table'[Month])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak No it's giving the count of rows for each month. Let me explain once again as i told based on the month selected it should give the result. Only 5 output i am expecting the result based on the month selected like if only 1 month selected than 1,

if 2 selecected than 2

if 3 selecected than 3

if 4 selecected than 4

if 5 selecected than 5

 

please do let me know how it can be acheived. 

Hi @Anonymous 

 


can you try this:

Number of selected months = CALCULATE(distinctcount('Table'[Month]))

 


Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Anonymous
Not applicable

No it's giving the count of rows for each month. Let me explain once again as i told based on the month selected it should give the result. Only 5 output i am expecting the result based on the month selected like if only 1 month selected than 1,

if 2 selecected than 2

if 3 selecected than 3

if 4 selecected than 4

if 5 selecected than 5

 

please do let me know how it can be acheived. 

danielkrol
Helper II
Helper II

Create a measure like this?

NoSelected = CALCULATE(COUNT('Yourtable'[columnName]))

where "Yourtable" is the table of your slicer and "columName" the column of the slicer.
Anonymous
Not applicable

No it's giving the count of rows for each month. Let me explain once again as i told based on the month selected it should give the result. Only 5 output i am expecting the result based on the month selected like if only 1 month selected than 1,

if 2 selecected than 2

if 3 selecected than 3

if 4 selecected than 4

if 5 selecected than 5

 

please do let me know how it can be acheived. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.