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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to capture all the selected values from a slicer and use it on a measure with IN VALUES()

Hi,
I need some help.😎

The measure 'MeasureWeeks' bellow works correct when selected one value from slicer (YearWeeknumber) for example value 202015.

Some records from tabel 'INFOR260_BSNS_ACT_PLANNING_T' will have Yes and some No.

What to do when i want to select more than one value. For example 202015, 2012019 and 202022.

Loop?

 

MeasureWeeks =

VAR checkDate =
    IF (
        SELECTEDVALUE ( 'DateTabel'[YearWeeknumber.] );
        MIN('DateTabel'[YearWeeknumber.] );
        concatenate(year(today());weeknum(today()))
        --"202012"
        )
RETURN
    IF (
               MIN ( INFOR260_BSNS_ACT_PLANNING_T[StartWeek] ) = Checkdate   && MIN ( INFOR260_BSNS_ACT_PLANNING_T              [EndWeek] ) = Checkdate
               ||
               MIN ( INFOR260_BSNS_ACT_PLANNING_T[EndWeek] )   = Checkdate
               ||
               MIN ( INFOR260_BSNS_ACT_PLANNING_T[StartWeek] ) = Checkdate
               ||
               MIN ( INFOR260_BSNS_ACT_PLANNING_T[StartWeek] ) < Checkdate   && MIN ( INFOR260_BSNS_ACT_PLANNING_T[EndWeek] ) > Checkdate
               ;
        "Yes";
        "No"
    )

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

When select 202015 from slicer the IF statement wil be StartWeek and EndWeek = 202015 (VAR checkDate).
Some records wil have MeasureWeeks Yes and some NO.
By filtering on MeasureWeeks = Yes is wil have the correct records.
This works correct when select one value.

I want to select more than one value from slicer: 202015 and  202018.

loop 1

StartWeek and EndWeek = 202015

loop 2

StartWeek and EndWeek = 202018

After the run I have all records that meet the specified conditions

 

Lex

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

The problem is not well-defined. Please, would you mind telling us what you want to achieve?

You say:
What to do when i want to select more than one value. For example 202015, 2012019 and 202022. Loop?

You should at least tell us what you want to do in your measure when there are multiple values selected in your slicer.

By the way, the first logical condition in the alternative under IF is completely redundant. You can and should remove it.

Best
D

Anonymous
Not applicable

Hi @Anonymous 

 

When select 202015 from slicer the IF statement wil be StartWeek and EndWeek = 202015 (VAR checkDate).
Some records wil have MeasureWeeks Yes and some NO.
By filtering on MeasureWeeks = Yes is wil have the correct records.
This works correct when select one value.

I want to select more than one value from slicer: 202015 and  202018.

loop 1

StartWeek and EndWeek = 202015

loop 2

StartWeek and EndWeek = 202018

After the run I have all records that meet the specified conditions

 

Lex

Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Can you explain what you are trying to accomplish?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.