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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Nishant77Goel
Frequent Visitor

How to use slicer selected column in formulas

Help needed!
Selected Parameter = maxx(filter('Date Value', 'Date Value'[Date Value Order] = SELECTEDVALUE('Date Value'[Date Value Order])), 'Date Value'[Date Value Fields])


This returns the name of selected column in slicer created using field parameter. 
I have 4 columns in slicer - "LAST_OPPORTUNITY_CHANGE_DT", "MBR_PGM_CREATE_DT", “MBR_PGM_ENROLL_DT","OPPORTUNITY_CREATE_DT"

 

Attaching test dashboard snapshot for your reference. 

Capture.PNG
Now based on the selected column name wants to create flag if the particular date of that column falls in last 180 days.
Last 180 days flag = IF([Selected Parameter] > (TODAY()-180),"1","0")

 

This is giving error, value coming from selected parameter is not considered as column but is considered as text. So it's not matching up with today()-180 days condition.


The value coming from selected parameter is not considered as column but is considered as text. So, it's not matching up with today()-180 days condition. If I directly consider column the formula is working fine.


Please suggest how should I approach this problem.

2 REPLIES 2
amitchandak
Super User
Super User

@Nishant77Goel , Can you share error you are getting

 

Also try this one as number

 

Last 180 days flag = IF([Selected Parameter] > (TODAY()-180),1,0)

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

Last 180 days1 = if(SELECTEDVALUE('Date Type'[Date Type Fields]) > (TODAY()-180),1,0)
Giving below error -

Capture2.PNG

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

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.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.