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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DataSkills
Resolver I
Resolver I

Using measure shows records that should be excluded (sample file included)

Hello, 

The attached PBIX file shows the issue. In essence, when using the measure (shown in the lower table), the slicer doesn't exclude any people. In the image below, I picked a specific facility (ID = 9), and as you can see, the top table shows only residents from that facility, whereas the lower table still shows residents from other facilities. 

DataSkills_1-1723025599711.png

I can solve the problem using a calculated column, but I am trying to NOT create a calculated column if I can help it. 

 

Click HERE to open the PBIX file. Then click the download button at top right to download the file. (See green arrow for download button). 

DataSkills_0-1723025556518.png

 

Thank you in advance. 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, 

I am not sure if I understood your semantic model correctly, but I suggest to try to start from the below measure. And then, I believe you can get to the goal that you need.

 

Weight Category Measure =
SWITCH (
    TRUE (),
    COUNTROWS ( Residents ) >= 1
        && ISBLANK ( MAX ( Residents[Weight] ) ), "No recorded weight",
    COUNTROWS ( Residents ) >= 1
        && MAX ( Residents[Weight] ) < 30, "Under 30kg in weight",
    COUNTROWS ( Residents ) >= 1
        && MAX ( Residents[Weight] ) > 130, "Over 130kg in weight",
    COUNTROWS ( Residents ) >= 1, "Normal weight"
)


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, 

I am not sure if I understood your semantic model correctly, but I suggest to try to start from the below measure. And then, I believe you can get to the goal that you need.

 

Weight Category Measure =
SWITCH (
    TRUE (),
    COUNTROWS ( Residents ) >= 1
        && ISBLANK ( MAX ( Residents[Weight] ) ), "No recorded weight",
    COUNTROWS ( Residents ) >= 1
        && MAX ( Residents[Weight] ) < 30, "Under 30kg in weight",
    COUNTROWS ( Residents ) >= 1
        && MAX ( Residents[Weight] ) > 130, "Over 130kg in weight",
    COUNTROWS ( Residents ) >= 1, "Normal weight"
)


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Hi Jihwan_Kim, thank you for that solution. That seems to have done the trick! 🤗

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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