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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Dynamic Value

Hai Guys Need help on this.
Requirement
I Have a Year slicer and a group slicer( Two slicers) year slicer are have the different years from 2018 to 2022
In the target table, the year column only has 2022 values, and different groups like this

Group YearTarget
India20223
Japan20223
Russia20223
Ukraine20223
UK20222
FRANCE20223

One condition > My manager wants to see if he doesn't select any filter(slicer) he wants to see a static value "10" otherwise that particular group value. 
2nd Condition > If he directly selects 2022 or any year without group slicer he wants to see the static value "0 ".
But He wants to see the actual target value when he selects that particular year with a particular group only
Please help with this.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous ,

You can use isfiltered

 

and create a measure like

 

Switch (True() ,

selectedvalue(Table[Year]) =2022 && not calculate( isfiltered(Table[Group]), allselected()) , 0 ,

not calculate( isfiltered(Table[Group]), allselected()) , 10

Sum(Table[Target])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like the attached.

 

Picture1.png

 

Target based on a condition: =
IF (
    HASONEVALUE ( Data[Group ] ),
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Group'[Group ] ) && ISFILTERED ( 'Year'[Year] ), SUM ( Data[Target] ),
        NOT ISFILTERED ( 'Group'[Group ] ) && ISFILTERED ( 'Year'[Year] ), 0,
        10
    )
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like the attached.

 

Picture1.png

 

Target based on a condition: =
IF (
    HASONEVALUE ( Data[Group ] ),
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Group'[Group ] ) && ISFILTERED ( 'Year'[Year] ), SUM ( Data[Target] ),
        NOT ISFILTERED ( 'Group'[Group ] ) && ISFILTERED ( 'Year'[Year] ), 0,
        10
    )
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

I Got The solution from your Logic Thanks For your help Jihwan

 
amitchandak
Super User
Super User

@Anonymous ,

You can use isfiltered

 

and create a measure like

 

Switch (True() ,

selectedvalue(Table[Year]) =2022 && not calculate( isfiltered(Table[Group]), allselected()) , 0 ,

not calculate( isfiltered(Table[Group]), allselected()) , 10

Sum(Table[Target])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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