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
dosinkevic
Frequent Visitor

IF statement or different solution?

How can I use IF statement in this case or it should be different solution?

 

I neet to run this formula only if Campaign {"date"} = CRM {"date"} then Column =....

Column = 
VAR __tmpTable = ADDCOLUMNS(ALL(crm),"Found",FIND([id],[camp_tracker],,-1))
RETURN COUNTROWS(FILTER(__tmpTable,[Found]<>-1))

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @dosinkevic,

 

Maybe you can try this formula.

Column =
VAR __tmpTable =
    ADDCOLUMNS ( ALL ( crm ), "Found", FIND ( [id], [camp_tracker],, -1 ) )
VAR campaign_date = [date]
RETURN
    COUNTROWS ( FILTER ( __tmpTable, [Found] <> -1 && [date] = campaign_date ) )

Best Regards,

Dale

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @dosinkevic,

 

Maybe you can try this formula.

Column =
VAR __tmpTable =
    ADDCOLUMNS ( ALL ( crm ), "Found", FIND ( [id], [camp_tracker],, -1 ) )
VAR campaign_date = [date]
RETURN
    COUNTROWS ( FILTER ( __tmpTable, [Found] <> -1 && [date] = campaign_date ) )

Best Regards,

Dale

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

Dale,

It works, thank you for help!

chotu27
Post Patron
Post Patron

@dosinkevic Use the Conditional column feature in editqueries so that you can keep your condition there.

In my case I have two queries Campaign and CRM. I can't select both in  Conditional column, plus I can't add my formula in Output.

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.