Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Using the measure below to dynamically reflect the logon user in a textbox. I would also like to color only the USERNAME() value returned BLUE
Any thoughts?
Measure
Solved! Go to Solution.
@mcijerry Add a text box to your Power BI report where you want to display the message.
In the text box, insert the measure you created. This will display the full message including the username.
Since DAX does not support text formatting, you will need to use Power BI's conditional formatting to color the username. Unfortunately, Power BI does not support conditional formatting within text boxes directly. However, you can use a workaround by creating a separate measure for the username and then using a card visual to display and format it.
Create a new measure for the username:
Username Only = USERNAME()
Add a card visual to your report and set its value to the Username Only measure.
Use the formatting options in the card visual to set the text color to blue.
Position the card visual with the username next to the text box so that it appears as part of the same sentence. This way, the username will be displayed in blue while the rest of the text remains in the default color
Proud to be a Super User! |
|
Hi @mcijerry
Measures cannot be partially conditionally formatted. You can however use a DAX-generated SVG image that partially colors a text.
Please see the attached sample pbix.
@mcijerry Add a text box to your Power BI report where you want to display the message.
In the text box, insert the measure you created. This will display the full message including the username.
Since DAX does not support text formatting, you will need to use Power BI's conditional formatting to color the username. Unfortunately, Power BI does not support conditional formatting within text boxes directly. However, you can use a workaround by creating a separate measure for the username and then using a card visual to display and format it.
Create a new measure for the username:
Username Only = USERNAME()
Add a card visual to your report and set its value to the Username Only measure.
Use the formatting options in the card visual to set the text color to blue.
Position the card visual with the username next to the text box so that it appears as part of the same sentence. This way, the username will be displayed in blue while the rest of the text remains in the default color
Proud to be a Super User! |
|
This worked great. I created another text box (referenced the GETUSERNAME Measure), resized it appropriately and turned off backgroud color----so it blended in perfectly with the textbox under it.
Thank you Bhanu!
User | Count |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |