cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Wresen Frequent Visitor
Frequent Visitor

Retrive slicer value to add in formula. (Column)

Hi all

I am a pretty new user to Power BI and i have encounter a problem with the Slicer that i do not understand.

 

I want created a new column in a table with the condition:

(Month1 > month2 && month1 = (the Slicer value) ;"YES";"NO")

 

I have been able to create (Month1>Month2 && Month ="201905" ;"YES";NO") 

Is it possible to do this (get the slicer value a variable for my column formula)

 

Thanks so much for all the help i can recive.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Retrive slicer value to add in formula. (Column)

Hi @Wresen ,

 

You cannot do this in a calculated column, as calculated column always returns static value once it has been initilized. However, you can achieve that via a measure.

Measure =
IF (
    SELECTEDVALUE ( TableName[Month1] ) > SELECTEDVALUE ( TableName[Month2] )
        && SELECTEDVALUE ( TableName[Month1] )
            SELECTEDVALUE ( SlicerTable[SlicerColumn] ),
    "YES",
    "NO"
)

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft Super Contributor
Super Contributor

Re: Retrive slicer value to add in formula. (Column)

Hi @Wresen ,

 

You cannot do this in a calculated column, as calculated column always returns static value once it has been initilized. However, you can achieve that via a measure.

Measure =
IF (
    SELECTEDVALUE ( TableName[Month1] ) > SELECTEDVALUE ( TableName[Month2] )
        && SELECTEDVALUE ( TableName[Month1] )
            SELECTEDVALUE ( SlicerTable[SlicerColumn] ),
    "YES",
    "NO"
)

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Wresen Frequent Visitor
Frequent Visitor

Re: Retrive slicer value to add in formula. (Column)

Thanks so much for the help.

Now i understand how to retrive the value from the slicer

 

I belivive i need to rethink how i should do my report now with this new.

 

Thanks again.

 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 109 members 1,580 guests
Please welcome our newest community members: