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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Filtered Calculated Measure

Hi There,

 

I am attempting to create a multi-filtered calculated measure in Power BI. Something like this: 

If Dimension contains Facebook OR Instagram OR Youtube, then sum(Column1), else Column2

 

Can someone help me with the DAX required to generate this output? 

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You want to use the IN operator.

 

See this article.

 

It would basically be something like:

 

Measure :=
IF (
    table[field] IN { "Facebook", "Instagram", "Youtube" },
    SUM ( table[field1] ),
    SUM ( table[field2] )
)

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Not sure if you have solved your problem, if not, you can create a calculated column just like @edhans  provided. You can refer to the PBIX file or the details

Filtered calculated measure.JPG

Best Regards

Rena

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

You want to use the IN operator.

 

See this article.

 

It would basically be something like:

 

Measure :=
IF (
    table[field] IN { "Facebook", "Instagram", "Youtube" },
    SUM ( table[field1] ),
    SUM ( table[field2] )
)

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.