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

ISFILTERED returning true value

Hello, I am using ISFILTERED in a calculation but it keeps returning true and not the actual values, any ideas why? below is my measure i am using

 

 

IF(ISFILTERED('Mgmt Levels'[Management Levels]),
ISINSCOPE( Goals[Group]),SELECTEDVALUE(Goals[2021 Female Goal]))||if(ISINSCOPE(Goals[Platform]),CALCULATE(sum(Goals[2021 Female Goal]),Goals[IsPlatform]=1))
1 ACCEPTED SOLUTION

OMG, that worked! THANK YOU!  One more question, if nothing in the filter is selected is there a way to set it to default to a certain number?

View solution in original post

12 REPLIES 12
AlexisOlson
Super User
Super User

How do you expect Management Levels to affect the calculation?

So, the below calcuation is actually working for me .  I have it set to filter on a specific value in my management level filter (M1-M3).  the issue with this measure is, i don't want to only filter on M1-M3, I want to filter on other values, any ideas?
 
var filtered = FILTER ('Goals',Goals[Mgmt Levels]= "M1-M3")
VAR _goal = SUMX(FILTER (filtered,[Mgmt Levels] in VALUES (Goals[Mgmt Levels])),IF(
ISINSCOPE( Goals[Group]),(Goals[2021 Female Goal]),if(ISINSCOPE(Goals[Platform]),CALCULATE(sum(Goals[2021 Female Goal]),Goals[IsPlatform]=1))))
return
_goal

Does this work?

SUMX (
    'Goals',
    IF (
        ISINSCOPE ( Goals[Group] ),
         ( Goals[2021 Female Goal] ),
        IF (
            ISINSCOPE ( Goals[Platform] ),
            CALCULATE ( SUM ( Goals[2021 Female Goal] ), Goals[IsPlatform] = 1 )
        )
    )
)

Assuming this is a measure, the Goals table will be filtered by whatever you set your Mgmt Levels to be.

unfortunately, it doesnt work.  I want my snapshot table to filter and not my goals table.  I still need to somehow connect the management level from my goals able to the management level from my snapshot data?

Sorry. I'm just shooting in the dark here since I still can't quite tell what's going on and what you're trying to do.

 

What if you replace the 'Goals' table argument from my suggestion with the following?

FILTER ( 'Goals', Goals[Mgmt Levels] IN VALUES ( 'Mgmt Levels'[Management Levels] ) )

 

If that doesn't work, I'd suggest trying to rewrite your question so that other people can understand it better.

OMG, that worked! THANK YOU!  One more question, if nothing in the filter is selected is there a way to set it to default to a certain number?

Hi @mmills2018,

Perhaps you can try to use 'if statement' to package and switch between two different conditions:

FILTER (
    'Goals',
    IF (
        COUNTROWS ( VALUES ( 'Mgmt Levels'[Management Levels] ) ) > 0,
        Goals[Mgmt Levels] IN VALUES ( 'Mgmt Levels'[Management Levels] ),
        Goals[Mgmt Levels] = "default value"
    )
)

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
BA_Pete
Super User
Super User

Hi @mmills2018 ,

 

If your first IF condition resolves to TRUE i.e. 'Mgmt Levels'[Management Levels] is filtered, then your output will be ISINSCOPE(...).

ISINSCOPE gives a boolean output, which is where I would guess your boolean measure result is coming from.

IF(
  ISFILTERED('Mgmt Levels'[Management Levels]),
  ISINSCOPE( Goals[Group]),     //This function gives Boolean output when first condition is TRUE
  SELECTEDVALUE(Goals[2021 Female Goal])
)
||
IF(
  ISINSCOPE(Goals[Platform]),
  CALCULATE(
    SUM(Goals[2021 Female Goal]),
    Goals[IsPlatform]=1
  )
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




So, the below calcuation is actually working for me .  I have it set to filter on a specific value in my management level filter (M1-M3).  the issue with this measure is, i don't want to only filter on M1-M3, I want to filter on other values, any ideas?
 
var filtered = FILTER ('Goals',Goals[Mgmt Levels]= "M1-M3")
VAR _goal = SUMX(FILTER (filtered,[Mgmt Levels] in VALUES (Goals[Mgmt Levels])),IF(
ISINSCOPE( Goals[Group]),(Goals[2021 Female Goal]),if(ISINSCOPE(Goals[Platform]),CALCULATE(sum(Goals[2021 Female Goal]),Goals[IsPlatform]=1))))
return
_goal

so, i am trying to not get a boolean output, when i use the measure below, i get the values that i want:

IF(
ISINSCOPE( Goals[Group]),SELECTEDVALUE(Goals[2021 Female Goal]),if(ISINSCOPE(Goals[Platform]),CALCULATE(sum(Goals[2021 Female Goal]),Goals[IsPlatform]=1)))
 
I am trying to add a slicer to this measure from an unrelated table. any ideas how i can do this without getting a boolean output?

@mmills2018 ,

 

I'm not entirely sure what you mean by "add a slicer...from an unrelated table".

 

It's very difficult for me to know what you need without seeing your data/data model and without knowing what this measure is supposed to do or what your desired output looks like.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@mmills2018 ,

 

I think I understand what you're getting at here now.

 

Have you tried just amending your first condition to include the requirement for your [Mgmt Levels] field to be filtered? Something like this:

IF(
  ISINSCOPE( Goals[Group]) && ISFILTERED('Mgmt Levels'[Management Levels]),
  SELECTEDVALUE(Goals[2021 Female Goal]),
  IF(
    ISINSCOPE(Goals[Platform]),
    CALCULATE(
      sum(Goals[2021 Female Goal]),
      Goals[IsPlatform]=1
    )
  )
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.