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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
dax_questions13
New Member

SUMIFS error in dax and creating a percentage column

I am trying to create a sumifs funtion in DAX, here is what I have so far

 

SUMIF = CALCULATE(SUM('Table1'[Count]),FILTER('Table1','Table1'[Key] && 'Table1'[Values] <> ""))
 
When I input this I get an error message that says that "DAX comparison operations do not support comparing values of type integer with values of type Text. Consider using the VALUE or FORMAT function to covert one of the values." How can I fix this? 
 
Based on the error message I think the problem is that the [Key] column is in text format and [Values] column is in integer format and FILTER can't compare the 2. Not sure how I can fix this. I am very new to power BI, just learning. Thx for helping.
1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @dax_questions13 ,

 

You need to declare the requirement of the first filter in your context as highligted below. Also I recommend that you use <>BLANK() as opposed to <>"" or you could use NOT ISBLANK(ColumnName)

 

SUMIF = CALCULATE(SUM('Table1'[Count]),FILTER('Table1','Table1'[Key] && 'Table1'[Values] <> ""))

 

Hope this helps

 

Did I help you today? Please accept my solution and hit the Kudos button.

 

View solution in original post

2 REPLIES 2
davehus
Memorable Member
Memorable Member

Hi @dax_questions13 ,

 

You need to declare the requirement of the first filter in your context as highligted below. Also I recommend that you use <>BLANK() as opposed to <>"" or you could use NOT ISBLANK(ColumnName)

 

SUMIF = CALCULATE(SUM('Table1'[Count]),FILTER('Table1','Table1'[Key] && 'Table1'[Values] <> ""))

 

Hope this helps

 

Did I help you today? Please accept my solution and hit the Kudos button.

 

That was helpful. <> Blank () did the trick. Thank you.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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