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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
asdf1608
Helper V
Helper V

Help in converting the tableau calculation to Power BI

I need help in converting the tableau calculation to Power BI. I find it  a bit difficult in converting.

 

IF([As Set] = True and [name Set] = True) then [Column A]
elseif ([As Set] = True and [name Set] = False) then [column B]
else "" end

 

Help with this will be very helpful.

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @asdf1608 

If you want to transfer it to a calculated column:

column=switch(true(),[As Set] = True() && [name Set] = True(),[Column A],[As Set] = True()&&[name Set] = False(),[column B],"")

If you want to transfer it to a measure:

measure=switch(true(),max([As Set]) = True() && max([name Set]) = True(),max([Column A]),max([As Set])= True()&&max([name Set]) = False(),max([column B]),"")

If you want to transferi it in power query:

= Table.AddColumn(#"Changed Type", "Custom", each if [As Set] = true and [name set]= true then [Column A] else if [As set]=true and [name Set]=false then [column B] else "")

Best Regards!

Yolo Zhu

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

7 REPLIES 7
Anonymous
Not applicable

Hi @asdf1608 

If you want to transfer it to a calculated column:

column=switch(true(),[As Set] = True() && [name Set] = True(),[Column A],[As Set] = True()&&[name Set] = False(),[column B],"")

If you want to transfer it to a measure:

measure=switch(true(),max([As Set]) = True() && max([name Set]) = True(),max([Column A]),max([As Set])= True()&&max([name Set]) = False(),max([column B]),"")

If you want to transferi it in power query:

= Table.AddColumn(#"Changed Type", "Custom", each if [As Set] = true and [name set]= true then [Column A] else if [As set]=true and [name Set]=false then [column B] else "")

Best Regards!

Yolo Zhu

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

giammariam
Solution Sage
Solution Sage

@asdf1608 try the following. Replace the <>s and their contents with the appropriate values. I'm making the assumption that this is for a calculated column.

 

<Column Name> =
IF (
    '<table name>'[As Set] = TRUE,
    IF (
        '<table name>'[name Set] = TRUE,
        '<table name>'[Column A],
        '<table name>'[Column B]
    ),
    ""
)

 

If this gets you what you need, please mark this as the solution. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

@giammariam. I tried the same way you mentioned but I am getting the following error message.

asdf1608_0-1673015356311.png

Why is this occuring? How can I solve this

How are the [As Set] and [name Set] columns formatted? I assumed they were booleans, but based on the error it sounds like they are formatted as text. If they are formatted as text, try this: 

 

<Column Name> =
IF (
    '<table name>'[As Set] = "True",
    IF (
        '<table name>'[name Set] = "True",
        '<table name>'[Column A],
        '<table name>'[Column B]
    ),
    ""
)

 

 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

@giammariam I created the column but I get this as count of column. Why is that?

@asdf1608 what visual are you using? Make sure to check the aggregation setting for the new column and use the one you need or use do not summarize. See below link:
https://learn.microsoft.com/en-us/power-bi/create-reports/service-aggregates



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

It worked. Thanks

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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