Forum Discussion

snaraya's avatar
snaraya
Helper II
3 years ago
Solved

Dynamic text value for single slicer value

I have a status table(manulaly created) as below which has extra value "Review" which is not avalaible in actual data table but have all other values.

 

STATUS TABLE                                                           
Status              Rank

Send1
Investigation2
Review3
Approval4
Closed5
Cancelled6

 

TABLE (has below status column but with lots of duplicate values)

Closed
Cancelled
Approval
Send
Investigation

 

 

I am using this status column from status table as a slicer in my visual page. This slicer and my actual data from table have 1-many relationship

 

I want to create a measure which shows dynamic text "There are no Emergency Messages in the (selected value) workflow Stage" if status value is not avaialble in table but available in Status table.  message should pop only when non matching status is selected individually or with other values. (it should be dynamic as per selection)

 

I created below formula

 

test = IF(SELECTEDVALUE('Status'[Status])=SELECTEDVALUE(table[Status])," ", "There are no Emergency Messages in" & " "&SELECTEDVALUE('Status'[Status])& " "& "workflow stage")

Please find below example 

it works fine if i am selecting only review(its non matching here) but if i select 1more status along with review it shows "There are no Emergency Messages in the workflow Stage". and if i select 3 status out of which one is review it dont show anything.
i want it to be shown the same message as 1st secreenshot for 2nd and 3rd screenshot and not show anything if something else is individualy selected (4th screenshot)
 
What i have: 1st and last screenshot are correct 
what i want: 2nd and 3rd screenshot should show same message as 1st 
 
Please find below example 
 
 

also using background color change on basis of same

BG = SWITCH(TRUE(), SELECTEDVALUE('Status'[Status])=SELECTEDVALUE(table[Status]),"White","Red")
 
I am partially there , can someone suggest what should be tweaked in my formula?

Thanks in Advance
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi snaraya ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create a measure. 

    test = IF(CONCATENATEX(EXCEPT(VALUES('STATUS'[Status]),ALLSELECTED('Table'[Status])),[Status]," ")<>BLANK(),"There are no Emergency Messages in" & " "&CONCATENATEX(EXCEPT(VALUES('STATUS'[Status]),ALLSELECTED('Table'[Status])),[Status]," ")& " "& "workflow stage","")

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi snaraya ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create a measure. 

    test = IF(CONCATENATEX(EXCEPT(VALUES('STATUS'[Status]),ALLSELECTED('Table'[Status])),[Status]," ")<>BLANK(),"There are no Emergency Messages in" & " "&CONCATENATEX(EXCEPT(VALUES('STATUS'[Status]),ALLSELECTED('Table'[Status])),[Status]," ")& " "& "workflow stage","")

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

  • Anonymous  Thankyou so much. Worked perfectly fine.😊