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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ramendra
Helper IV
Helper IV

formula context

Hi Team,

Can you please help me to know that how to apply below formula in Power Bi for a table

Countif(K4:Q29,"<=6")

1 ACCEPTED SOLUTION

Hi @Ramendra ,

 

Add an index column in the query editor.

Select the index column and unpivoted other column.

Extract the number after "U".

Converts your selected range to a filter condition in DAX.

test_formula context.PNG

Sample .pbix

 

Best Regards,
Liang
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

6 REPLIES 6
amitchandak
Super User
Super User

@Ramendra , if it is one column you can do like

countX(filter(Table,Table[col] <=6),Table[Col])

 

else Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

@amitchandak , no this is not for a single column.

This is a range of columns in a table.

Can you please suggest for this.

 
 

test.PNG

harshnathani
Community Champion
Community Champion

Hi @Ramendra ,

 

 

https://community.powerbi.com/t5/Community-Blog/CO-CU-Excel-to-DAX-Translation/ba-p/1080018#M2077

 

CALCULATE(COUNT('Table[ColumnName),FILTER('Table', Table[ColumnName] <= 6))

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

@harshnathani ,

 

No this is for a range including more than one column.

Can you suggest for this.test.PNG

Hi @Ramendra ,

 

Add an index column in the query editor.

Select the index column and unpivoted other column.

Extract the number after "U".

Converts your selected range to a filter condition in DAX.

test_formula context.PNG

Sample .pbix

 

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

@V-lianl-msft,

Thank you for your help.

It was a great idea to unpivot  columns to convert multiple columns in to one and then to apply formula to a final column and I got the expected output as per my requirement.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.