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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PBI_newuser
Post Prodigy
Post Prodigy

Measure fetch 2 values from slicer

Hi,

I need to select 2 values from slicer to populate the correct value.

How to modify the measure to the below selectedvalue?

[Product]

Slicer [Country]

Slicer [ Name]

Product A

US

Product A

Product B

US

Product B

Product C

Canada

 

 

Measure =
IF(
    ISFILTERED(Slicer[Name]),
    SWITCH(
        SELECTEDVALUE(Slicer[Name]),
        "Product A",CALCULATE(MAX([Value]),FILTER('Table',[Product]="Product A")),
        "Product B",CALCULATE(MAX([Value]),FILTER('Table',[Product]="Product B")),
        "Product C",CALCULATE(MAX([Value]),FILTER('Table',[Product]="Product C"))),
    CALCULATE(MAX([Value]),FILTER('Table',[Product]="All")))

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @PBI_newuser,

Perhaps you can try the following measure formula if it meets your requirement:

Measure =
CALCULATE (
    MAX ( [Value] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        IF (
            ISINSCOPE ( Slicer[Country] ),
            [Country] IN VALUES ( Slicer[Country] ),
            [Country] = "All"
        )
            && IF (
                ISINSCOPE ( Slicer[Name] ),
                [Name] IN VALUES ( Slicer[Name] ),
                [Name] = "All"
            )
    )
)

Regards,

Xiaoxin Sheng

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

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @PBI_newuser,

Perhaps you can try the following measure formula if it meets your requirement:

Measure =
CALCULATE (
    MAX ( [Value] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        IF (
            ISINSCOPE ( Slicer[Country] ),
            [Country] IN VALUES ( Slicer[Country] ),
            [Country] = "All"
        )
            && IF (
                ISINSCOPE ( Slicer[Name] ),
                [Name] IN VALUES ( Slicer[Name] ),
                [Name] = "All"
            )
    )
)

Regards,

Xiaoxin Sheng

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

@PBI_newuser , Try a measure like

Measure =
IF(
    ISFILTERED(Slicer[Name]) || ISFILTERED(Slicer2[Name]) ,
    CALCULATE(MAX([Value]),FILTER('Table','Table'[Product]  in allselected(Slicer[Name])  && 'Table'[COUNTRY]  in allselected(Slicer2[Name]) )))
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
amitchandak
Super User
Super User

@PBI_newuser , Not able to relate what is raw data, What are the slicers? Are slicer independent so we need handle. What is final outcome needed

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak this is an issue arised from the below topic.
https://community.powerbi.com/t5/Desktop/Slicer-for-all-products/m-p/1488926#M618213

I have 2 slicers for user to select which are "Country" and "Name".
How can I include these 2 fields in the "SELECTEDVALUE" function?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.