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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Pbiuserr
Post Prodigy
Post Prodigy

How to handle that in most efficient way - counting blanks / no blanks

Hello,
My next task is to recreate a report based on new schema and data sources. I can see in measures of legacy report, that basically what developer did is : 

Create one measure like

NotBlank = VAR num=CALCULATE(COUNTROWS('Table'),'Table'[Column]<>blank()) RETURN IF(num<>blank(),num,0)
Blank  = VAR num=CALCULATE(COUNTROWS('Table'),'Table'[Column]=blank()) RETURN IF(num<>blank(),num,0)

Similary to count just DISTINCTCOUNTNOBLANK

Is there any better approach? Like establish that in PQ with either 0 and 1 or get the datasource with CASE or how? The drawback of SQL would be that they often count calculated columns, so I guess its not available in SQL/PQ unless I create it there.

These NotBlank and Blank are referenced in several other measures so I can't get them as variables, not convienient I guess

Thank you for your input and suggestions
1 REPLY 1
lbendlin
Super User
Super User

Read about COALESCE and the measure=0+x hack.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors