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
Anonymous
Not applicable

I don't want to involve blank cells in my measure

td42_0-1669824314036.png

I'm now doing a internship so im a noob with Power BI. the thing is, on the left i have hours and on the right the standard worktime. i want to show if someone goes over the standard worktime it will turn red. but now even if its blank it turns red. im new with dax. what i did was if hours - worktime >= turn green otherwise red:

td42_1-1669824500794.png

can someone please help im wiasting too much time.

 

5 REPLIES 5
v-mengzhu-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this measure:

vmengzhumsft_0-1669882183885.png

Measure = IF(SELECTEDVALUE('Table'[hours])-SELECTEDVALUE('Table'[standard worktime])>=0,"#FF0000","#00FF1E")

 

And this is my conditional formatting:

vmengzhumsft_1-1669882899073.png

 

You can also refer to my pbix file for better understanding.

 

Best regards,

Community Support Team Selina zhu

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

 

Anonymous
Not applicable

Hi, 

Thanks for your answer i really appreciate it, but the thing is i want the blank fields to not be included in the measure. so i want the rows that dont have a working time to be the same as before. if i look at what you did i still see the second row (in your printscreen) turning red while there is no working time. i tried your measure but i get the same result as mine....

 

Kind regards, 

TD

Hi @Anonymous ,

 

If you don't want the blank row, you can directly filter it out, like this:

vmengzhumsft_0-1669960093852.pngvmengzhumsft_1-1669960113826.png

Please check the pbix file I uploaded above to make sure it is not different from your process.

 

Best regards,

Community Support Team Selina zhu

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

Anonymous
Not applicable

Hi, thanks for your reply i really appreciate it!

 

the thing is i dont want the blank rows to be involved in the maesure. so if there is a blank standard working time, then i want hours not to be involved to any measure or condition. so it will be the same colour and still shows hours.

 

so for you to understand i want this: 

td42_0-1669966287402.png

i hope you understand what i want to do. 

thankyou for your reply!!

Anonymous
Not applicable

td42_1-1669966415112.png

Sorry i mean i want it like this

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