cancel
Showing results for
Did you mean:

## Formula If+Atrr a power bi

Hello, I'm looking for a way to make this formula that I have in tableau a power bi

IF ATTR([Line ID]) = 'ALA' THEN AVG([Freepool])
ELSEIF ATTR([Line ID]) = 'CTS' THEN AVG([Freepool])
ELSE SUM([Freepool])
END

1 ACCEPTED SOLUTION
Super User

Oh I see! I thought Attr would be the name of the table and [line ID] a column name in the table. Could SELECTEDVALUE or VALUE be the PBI equivalent to the ATTR function in Tableua? Note, this is a pretty wild guess.

Otherwise, you might be able to give a little bit more of a context on what you would like to achieve maybe even with some sample data?

Proud to be a Super User!

4 REPLIES 4
Community Support

Thanks for reaching out to us.

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

Best Regards,

Community Support Team _Tang

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

Hi Tom, thanks but it did not work for me, in power bi it does not have the ATTR as in tableau.

Super User

Oh I see! I thought Attr would be the name of the table and [line ID] a column name in the table. Could SELECTEDVALUE or VALUE be the PBI equivalent to the ATTR function in Tableua? Note, this is a pretty wild guess.

Otherwise, you might be able to give a little bit more of a context on what you would like to achieve maybe even with some sample data?

Proud to be a Super User!

Super User

`IF ( ATTR([Line ID]) = "ALA", AVERAGE ( [Freepool] ), IF ( ATTR([Line ID]) = "CTS" ), AVERAGE ( [Freepool] ), SUM ( [Freepool] ) ) )`

Let me know if this works 🙂

Proud to be a Super User!

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors