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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TomasB
Frequent Visitor

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
TomasB
Frequent Visitor

@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 @TomasB, can you share the measure code and some details of expected result?

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 @TomasB, 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! 🙂  

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors