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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
craghubi2020
Frequent Visitor

Convert SQL query to DAX Command

Hello,

 

Could you please help in converting the below sql into DAX command.

 

select count(*) from table1
where column1 < 0.6

 

Thanks

Raghu

1 ACCEPTED SOLUTION

@craghubi2020 , 

countrows(filter(NvmWritingsInkUsage,NvmWritingsInkUsage[nvm_life]>.6 && NvmWritingsInkUsage[nvm_life] <.8))

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

View solution in original post

4 REPLIES 4
craghubi2020
Frequent Visitor

@amitchandak .

Also, I was trying on the below sql query with DAX command but it seems to be invalid. can you please help me to find mistake in the below DAX.

countrows(filter(NvmWritingsInkUsage,NvmWritingsInkUsage[nvm_life]>.6 and <.8)).

select count(*) from table1
where column1 > 0.6 and column1 < 0.8

@craghubi2020 , 

countrows(filter(NvmWritingsInkUsage,NvmWritingsInkUsage[nvm_life]>.6 && NvmWritingsInkUsage[nvm_life] <.8))

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
Super User
Super User

@craghubi2020 ,

Try a measure

countx(filter(Table1,Table[column1]<.6), Table[column1])

 

Or a measure like

countrows(filter(Table1,Table[column1]<.6))

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 Thanks for the quick response. this command is working. I'm need to validate with the data with business. I will let you know.

 

Thanks

Raghu

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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