Forum Discussion
Text based on Field parameter selection
Hi All,
Please suggest measure to udpate text based on Field parameter selction. EX, below
Field Parameter:
Snagalapur , Try using
DAX
PlaceholderText =
VAR selectedValue = SELECTEDVALUE('Seg/BU/Sub BU/Product'[Seg/BU/Sub BU/Product Fields])
RETURN
IF(
ISBLANK(selectedValue),
"No Selection",
SWITCH(
selectedValue,
0, "Segment",
1, "BU",
2, "Sub BU",
3, "Product Grp",
4, "Product",
"Invalid Selection"
)
)
8 Replies
- pankajnamekar25Super User
Hello Snagalapur
You can try this
Placeholder Text =
VAR selectedValue = SELECTEDVALUE('Seg/BU/Sub BU/Product'[Seg/BU/Sub BU/Product Fields])
VAR result =
SWITCH(
TRUE(),
selectedValue = "Segment", "Segment Selected",
selectedValue = "BU", "BU Selected",
selectedValue = "Sub BU", "Sub BU Selected",
selectedValue = "Product Grp", "Product Group Selected",
selectedValue = "Product", "Product Selected",
"No Selection"
)
RETURN
resultThanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
- SnagalapurHelper IV
thank you for details, I have issue code is returning No selection here.
- bhanu_gautamSuper User
Snagalapur , Try using
DAX
PlaceholderText =
VAR selectedValue = SELECTEDVALUE('Seg/BU/Sub BU/Product'[Seg/BU/Sub BU/Product Fields])
RETURN
IF(
ISBLANK(selectedValue),
"No Selection",
SWITCH(
selectedValue,
0, "Segment",
1, "BU",
2, "Sub BU",
3, "Product Grp",
4, "Product",
"Invalid Selection"
)
) - donsvensenSkilled Sharer
Hi
Have a look at this article - Using SELECTEDVALUE with Fields Parameters in Power BI - SQLBI
Erik
- CookistadorSuper User
Your logic is working, as you have something selected, it returns No selection
To avoid this issue, the following approach should solve
Placeholder Text =
VAR SelectedValue = SELECTEDVALUE('Seg/BU/Sub BU/Product'[Seg/BU/Sub BU/Product Fields])
RETURN
IF(
ISBLANK(SelectedValue),
"No Selection",
SelectedValue
) - v-priyankataCommunity Support
Hi Snagalapur
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- v-priyankataCommunity Support
Hi Snagalapur
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you. - v-priyankataCommunity Support
Hi Snagalapur
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.