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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Conditional Formatting - Inable to select the data type

Hi! I was developing a Power BI Dashboard and i want to create a conditional formatting to add icons to a card.

I have a table, which is a query from Teradata. It has a column called "Q_CUITS_SIMULADOS" which is basically an integer.

 

TomasB_1-1693835568086.png

 

When I try to create the conditional formatting I have the next problem:

 

TomasB_0-1693835538969.png

 

When I define the rules (min and max) I can´t select the data type (Number or Percentage), but my value is a number. The second rule is set to percentage so I don´t get what I want.

 

How I could solve that?

 

Thank you so much!

 

6 REPLIES 6
Anonymous
Not applicable

@Sergii24 Hi Sergi, i could sove that. I had to change "resume value as " : no resume. Now, I have the same problem but in this case for a measure. Do you know how to solve it?

Hi @Anonymous, can you share the measure code and some details of expected result?

Anonymous
Not applicable

Sorry for the delay. Yes, The measure is the next one:
SUM_CUITS =
SUM(Q_CUITS_SIMULADOS)
If SUM_CUITS > 0 THEN I WANT TO SEE THE RESULT OF SUM_CUITS AND THE GREEN CHECK MARK OF THE CELL ELEMENTS, ELSE I WANT A RED CROSS.

 

 

You'll need at least two measures:

  • the first one will make a calculation. This is the one you need to use on canvas to visualize the output.
  • the second, the technical one, will be used for conditional formatting. It's formula should be the same as of the first measure, but result should contain a requested color in hex format (ex. "ffcccc"). Then you need to apply condtional formatting on values of the first measure, selecting (field value) in conditional formatting menu. 
    • I suggest you to start from a simple background color to make sure that your measure works. If I'm not mistaken, you can't apply measure result for selecting an "icon". The workaround would be to use FORMAT() DAX fucntion to concatenate the first measure result with the second one (in such case you can replace color with icon using windows key + "." to select a desired icon). Be aware that in this case your result will be a string, so you won't be able to apply math fucntions or sort those values based on number from the first measure.

Try it out and let us know in case of issues! 

Sergii24
Super User
Super User

Hi @Anonymous, I've tried to replicate your case but it works fine:

Sergii24_0-1693836694268.png

 

I would suggest the following:

  • replicate the same case with sample data in new pbix file (so you know that conditional formatting works as expected)
  • in a new file, replace the sample data with data from your current pbix (now you assure that your data is okay)
  • replicate the case on a new page of the initial pbix file (to assure that pbix with your model works fine)
  • if all above works but your conditional formatting still doesn't work at canvas, try to recreate the page

Good luck! 🙂  

 

Anonymous
Not applicable

Hi! How are you? Thank you! I will try that. Can it be related to the query?

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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