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
Anno2019
Helper IV
Helper IV

Use Measure as a filter and use measure in if statement

Hi Guru's

Having some trouble with what seems to be an easy problem.  Multiple posts on this subject but does not match my problem completely, as my measures return text results.

PBIX file shared in below link.

https://www.dropbox.com/s/3hlfqjrgx600b7a/Measure%20as%20filter%20and%20calculate%20if%20on%20measur...

 

1.   I need to use [Multiple Fruits] as a filter, there are two results "More than One" & "Only One", User needs to be able to choose 1 or both, and the list should show all rows where either "More than One" is selected or "Only One" is selected or Both.

2.  [5.Red More than One Sales] = If [Customer Type] = "RED" and [Multiple Fruits] = "More than One" then [Total Sales Sum]

3.  [5.Red Only One Sales] = If [Customer Type] = "RED" and [Multiple Fruits] = "Only One" then [Total Sales Sum]

 

Measure as filter and calculate if on measure.JPG

 

 

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your data model correctly, but your measure [Multiple Fruits] and calculated column Table[Multiple Fruits DIM] are different. If using the measure [Multiple Fruits] is correct, please check the below measures and the attached pbix file.

 

5.Red More than One Sales =
CALCULATE (
    [Total Sales Sum],
    FILTER (
        'Table',
        'Table'[Customer Type] = "Red"
            && [Multiple Fruits] = "More than One"
    )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim 

Thank you! Points 2 & 3 work as per your guidance.

The [Multiple Fruits DIM] was my lame attempt to try to use it as a filter but it does not work.

 

Would you have any guidance on how I could use [Multiple Fruits] results as a filter?  Not the [Multiple Fruits DIM]

 

Hi,

You can create a calculate column.

I tried to create it, however, it is quite difficult for me to understand the logic how you create measures especially percentage measures, and it is not easy for me to create a calculated column without understanding a logic that you applied for all your measures.

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.