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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
thliberato
Helper I
Helper I

Value selected in the filter

 How do I get a value selected in the filter to use in a measure ?
 
For Example.
I create a filter with myoptions.

I created a measure named Test (I know that this sintax is wrong).

Test = if( <<<myoption selected in the filter>>> = "Option 1";"OK";"NOTOK")
 
In creating my measurement I need to check the value selected in the filter. Which command to use to retrieve this selected value in the filter?
 
 
4 REPLIES 4
JaimeG
New Member

you can try this

 

Measure = CALCULATE(SUM(Table[Fieldvalue]);FILTER(Table;Table[FieldOption]="Option 1"))

you can use SUM, COUNT, and any agregate function

Baskar
Resident Rockstar
Resident Rockstar

am not getting what u exactly want to achieve . okay for my assumption.

 

If u select some value in slicer do u want to get that selected value in measure ? if yes try this.

 

 

CALCULATE(   CONCATENATEX(
                       VALUES( "Column Name" ),"," 

)

 

 

Let me know if any help

v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @thliberato,

You'd better use swith function as the follewing fformula. When you select the "Current" value, it will run the [Internet Total Sales] measure, when select the "MTD", it will run [MTD Sales] and so on. If you don't select, it will return balnk.

Sales := 
    SWITCH ( 
        VALUES ( Period[Period] ), 
        "Current", [Internet Total Sales], 
        "MTD", [MTD Sales], 
        "QTD", [QTD Sales], 
        "YTD", [YTD Sales], 
         BLANK () 
    ) 


For more details, please refer to the article.

Best Regards,
Angelia

MrPowerBIPro
Advocate II
Advocate II

HI

You can use a measure for filter option that is selected (You can use switch function) and then use it in the final expression.

Switch function:

https://msdn.microsoft.com/en-us/library/gg492166.aspx

I am ready for any help!

Regards

Mostafa

Enemy of can't
www.mrpowerbi.pro

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors