Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello.
I've been trying to create a conditional column and am facing the 'DAX comparison operations do not support comparing values of type Integer with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values' error.
The formula should be something like this (taken from Tableau):
IF [Case Number]= [Case Number (Cases w Article Attached 2020+)] THEN 'Cases with Article attached' ELSE
'Cases without article attached' END
My power bi formula:
Hi, @Anonymous
In you tableau formula, isblank() function doesn't appear, I don't know why you use it in dax.
You can try:
Cases with Article =
IF (
'Tech Case Report'[Case Number] <> 'Tech Case Report'[Cases With Article attached Report.Case Number],
"Cases with Article Attached",
"Cases without Article"
)
Cases with Article =
IF (
'Tech Case Report'[Case Number]
<> SELECTEDVALUE ( 'Tech Case Report'[Cases With Article attached Report.Case Number] ),
"Cases with Article Attached",
"Cases without Article"
)
Cases with Article =
IF (
ISBLANK ( 'Tech Case Report'[Cases With Article attached Report.Case Number] ),
IF (
'Tech Case Report'[Case Number]
= SELECTEDVALUE ( 'Tech Case Report'[Cases With Article attached Report.Case Number] ),
"Cases with Article Attached",
"Cases without Article"
)
)
If the result isn't correct, please describe your logic or give some data, I need context to correct the code.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-janeyg-msft .
Thank you for your reply.
I tried running your formulas but I didn't get the correct number.
Basically, there are 2 excel files which are:
Tech Case Report & Cases with Article attached Report.
These reports are merged.
Both of these reports have case numbers (column).
So, if both the case number are similar, it shall display "Cases with Article" whereas if it doesn't match it shall display "Cases without Article".
I even tried creating 2 separate measures but I find it difficult to use them in conditional columns later. Thus, I need this current formula to be in a conditional column.
There's weirdly a '1' in the visualisation.
Please help.
Hi, @Anonymous
Can you share some sample data and your logic and your desired result? Then we can help you quickly and accurately, because your description is not very clear and we can't judge and test.
Reference:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
Best Regards
Janey Guo
check the syntax first
//Sales to Previous Year Ratio
= IF( ISBLANK('CalculatedMeasures'[PreviousYearTotalSales])
, BLANK()
, ( 'CalculatedMeasures'[Total Sales]-'CalculatedMeasures'[PreviousYearTotalSales] )
/'CalculatedMeasures'[PreviousYearTotalSales])
Link to official documentation
screenshot:
hope this help.