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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Oisdf
New Member

DAX if this and this then that

Hi All,

I know there's countless threads on DAX help but I've found none that have addressed my issue, I'm new to PBI so please be patient with me, I'm sorry if this is something obvious.

 

Let me know what I am doing wrong here, this DAX code to create a new collumn is not working - All of these data types are whole numbers - yes this is reflected Formatting>Data type.

 

 

 

INVALID_FILTER = 
IF([INVALID_CALC] < "8" ,
	IF([PARAM_C] >= [INVALID_CALC], [PARAM_C], "" )
        ,
	IF(([PARAM_C]/[SITES_TESTED])*100 >= [INVALID_CALC],[PARAM_C], "" )
)

 

 

 

 but I keep getting this error:

 

 

 

DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

 

 

 

I have tried applying VALUE and FORMAT to all the values in my above script like this:

 

 

INVALID_FILTER = 
IF(VALUE([INVALID_CALC]) < "8" ,
	IF(VALUE([PARAM_C]) >= VALUE([INVALID_CALC]), VALUE([PARAM_C]), "" )
        ,
	IF((VALUE([PARAM_C])/VALUE([SITES_TESTED]))*100 >= VALUE([INVALID_CALC]),VALUE([PARAM_C]), "" )
)

 

 

but it doesnt work, instead giving this error, which is slightly different.

 

 

DAX comparison operations do not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

 

 

What am I doing wrong?
Thanks for your time.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Oisdf  Great question, 

 

You are using Quotes "" on your numbers, which converts them to text, so try:

 

INVALID_FILTER = 
IF([INVALID_CALC] < 8 ,
	IF([PARAM_C] >= [INVALID_CALC], [PARAM_C], "" )
        ,
	IF(([PARAM_C]/[SITES_TESTED])*100 >= [INVALID_CALC],[PARAM_C], "" )
)

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

4 REPLIES 4
AllisonKennedy
Super User
Super User

@Oisdf  Great question, 

 

You are using Quotes "" on your numbers, which converts them to text, so try:

 

INVALID_FILTER = 
IF([INVALID_CALC] < 8 ,
	IF([PARAM_C] >= [INVALID_CALC], [PARAM_C], "" )
        ,
	IF(([PARAM_C]/[SITES_TESTED])*100 >= [INVALID_CALC],[PARAM_C], "" )
)

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you @AllisonKennedy ! 
Collumn is working now, however the data is not as expected. All values are appearing as Null.


Example here, this row should not be Blank , it should be PARAM_C (10)

IF([PARAM_C] >= [INVALID_CALC], [PARAM_C], "" 

Oisdf_0-1645695724882.png

 

Can you spot anything wrong?

@Oisdf You need to create this as a MEASURE, not a COLUMN to have it recognize the measures, hopefully this article helps explain things: https://excelwithallison.blogspot.com/2020/09/reporting-order-of-operations.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Samarth_18
Community Champion
Community Champion

Hi @Oisdf ,

 

Please try this:-

 

INVALID_FILTER =
IF (
    [INVALID_CALC] < 8,
    IF ( [PARAM_C] >= [INVALID_CALC], [PARAM_C], BLANK () ),
    IF (
        ( [PARAM_C] / [SITES_TESTED] ) * 100 >= [INVALID_CALC],
        [PARAM_C],
        BLANK ()
    )
)

 

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors