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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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