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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SADI
Regular Visitor

need to know which formula to use

i am using below formula to calculate the valid and invalid parameters. i want to calculate that if  column (tblpremierlabor[CustomTagName]="IMT" IMT value then if column is (tblpremierlabor[IMT Tag Validation]<=(tblpremierlabor[LaborDescription - Copy.1] then it should say false and true if this is not matching this criteria.

 

 

imt test = IF(tblpremierlabor[CustomTagName]="IMT",(tblpremierlabor[IMT Tag Validation]<=(tblpremierlabor[LaborDescription - Copy.1],true,false)))
4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi, @SADI

Do you want to calculate it in edit querie or data model by dax?

If you just want to add a calculate column

 

imt test =
IF (
    tblpremierlabor[CustomTagName] = "IMT",
    IF (
        tblpremierlabor[IMT Tag Validation]
            <= tblpremierlabor[LaborDescription - Copy.1],
        TRUE (),
        FALSE ()
    )
)

 

If not your case, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlB
Super User
Super User

Hi @SADI

It's difficult to understand what you need from that description. Maybe you could try to explain it with an example or with something like: 

 

IF Condition1

     then {

             IF Condition2

                     then

                           result= A

                     else

                           result=B

             }

       else{

             result=C

             }          

 

 

My guess from what you describe:

 

 

imt test =
IF (
    tblpremierlabor[CustomTagName] = "IMT" && tblpremierlabor[IMT Tag Validation] <= tblpremierlabor[LaborDescription - Copy.1],
    TRUE (),
    FALSE ()
)
 
 
 

 

 

SADI
Regular Visitor

Hello AIB,

 

As requested, Please find below clarification. If condition one matches then condition 2 need to execute after that result should be in true or false.

 

I tried the formula mentioned by you but it is giving error “DAX comparison operations do not support comparing values of type number with value of type text. “

IF Condition1

     then {

             IF Condition2

                     then

                           result= A

                     else

                           result=B}          

 

Regards

 

Saurabh

hi, @SADI

 tblpremierlabor[IMT Tag Validation] <= tblpremierlabor[LaborDescription - Copy.1]

 tblpremierlabor[IMT Tag Validation] should be text format, tblpremierlabor[LaborDescription - Copy.1] should be numerical format,

So they couldn't be compared.  You should keep them be same format or create a mapping column/ table for text format.

For example: we couldn't compare "A" to 3, but if "A" =5, we could get known that "A" will greater than 3.

 

please share a simple sample pbix file or some data sample and expected output. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

 

 

 

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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