cancel
Showing results 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

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]

3 REPLIES 3
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.

Helper IV

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]

Super User

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.

Announcements

#### 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.

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors