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

New Member

## If and Slicer filters

Hi all,

I would like to use an IF function and not apply a measure and get blank if one or two of the slicers have filters selected.

How could I do that?

Best regards

1 ACCEPTED SOLUTION
Community Support

Hi @ecmsev ,

One sample for your reference, here I create a measure using HASONEVALUE to work on it.

```Measure =
VAR A =
HASONEVALUE ( Table1[SLICER1] )
VAR B =
HASONEVALUE ( Table2[SLICER2] )
RETURN
IF (
A = TRUE ()
&& B = TRUE (),
MAX ( Table1[SLICER1] ) - MAX ( Table2[SLICER2] ),
0
)
```

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
3 REPLIES 3
Community Support

Hi @ecmsev ,

One sample for your reference, here I create a measure using HASONEVALUE to work on it.

```Measure =
VAR A =
HASONEVALUE ( Table1[SLICER1] )
VAR B =
HASONEVALUE ( Table2[SLICER2] )
RETURN
IF (
A = TRUE ()
&& B = TRUE (),
MAX ( Table1[SLICER1] ) - MAX ( Table2[SLICER2] ),
0
)
```

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Memorable Member

take a look at selectedvalue and hasonevalue dax functions

there are several videos showing how this works e.g.

New Member

¿Is it possible to create two measures with ISFILTERED()*1 for each slicer and after use both in the IF function?

IF(Measure1+Measure2)>=2;"0";column1-column2)

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.