Reply
avatar user
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

 

avatar user
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

avatar user
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!!

avatar user
Anonymous
Not applicable

td42_1-1669966415112.png

Sorry i mean i want it like this

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)