cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Route11
Post Prodigy
Post Prodigy

Dynamically change text box or card value

Hi Experts

How would you dynamically change the value in a card or text box based on the election made in two slicers.

1. Slicer options are. Year either 2017, 2018 Dec
2. Slicer options are. AOP or PY
So if user select from first slicer 2017 and the AOP from 2nd slicer then in card or text box show

2017
AOP
On two lines.
1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft
Microsoft

Hi @Route11,

 

You could add below measure to card visual.

Measure =
SELECTEDVALUE ( Table1[Year] ) & UNICHAR ( 10 )
    & SELECTEDVALUE ( Table1[Category] )
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

9 REPLIES 9
v-yulgu-msft
Microsoft
Microsoft

Hi @Route11,

 

You could add below measure to card visual.

Measure =
SELECTEDVALUE ( Table1[Year] ) & UNICHAR ( 10 )
    & SELECTEDVALUE ( Table1[Category] )
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.
Anonymous
Not applicable

You say to "add a measure" to the visualization but you don't say how to do it.


@v-yulgu-msft wrote:

Hi @Route11,

 

You could add below measure to card visual.

Measure =
SELECTEDVALUE ( Table1[Year] ) & UNICHAR ( 10 )
    & SELECTEDVALUE ( Table1[Category] )
Best regards,
Yuliana Gu

 

Anonymous
Not applicable

Thank you. You made my day. 

Thanks for the excellent feedback....can you explain what the UNICHAR (10) does so i can learn

Hi @Route11,

 

UNICHAR function returns the Unicode character referenced by the numeric value. unichar(10) returns a unicode in your measure, and it is recognised by a text. Here are some links for you to better understand its usage.

DAX UNICHAR Function in Power BI

Concatenate text with newlines in Power BI

 

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.
parry2k
Super User
Super User

@Route11 not sure about the two lines of code but you can create measure to combine values from the slicers:

 

Selected Slicer Value = 
SELECTEDVALUE( Table1[Slicer1] ) & " "  & 
SELECTEDVALUE( Table1[Slicer2] ) 





Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





nancmadi
Frequent Visitor

Worked perfectly, Thank you!!

Anonymous
Not applicable

How do you put a measure into a text box? I can only type in text. 


@parry2k wrote:

@Route11not sure about the two lines of code but you can create measure to combine values from the slicers:

 

Selected Slicer Value = 
SELECTEDVALUE( Table1[Slicer1] ) & " "  & 
SELECTEDVALUE( Table1[Slicer2] ) 

 

Hi @Route11 

   I think you can create 2 Measures based on the slicer secltion and use them in Multirow card.

 

Measure1 = SELECTEDVALUE (Table1[Year])

Measur 2 = SELECTEDVALUE( Table1[Category]).

 

Place them in the Multirow card to get the desired result. You can do little bit of formatting like removing header etc.

 

Thanks
Raj

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors