cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

return blank if the column is blank

Dear Community, 

 

I have two question.

i.) If number <=4 , return false . More than it will be true. I get the Dax. But I do not want the blank value in DiffDay return anything. But this DAX return false to the blank value. 

True/False = IF(SubBV[DiffDay]<=4, "False", IF(SubBV[DiffDay]>=5, "True" ))
 
ii.) Would like to have a conditional table formatting for TRUE/FALSE column blackground colour. If false will get green, while true will be red.
I have go thru some article and follow their instruction to perform. But its return some of the false column I get red. 
 
NickProp28_0-1599449497011.png

 

 

Appreciate and thanks for the help.
1 ACCEPTED SOLUTION

Accepted Solutions

@NickProp28 , I forgot My own suggested solution. Check now.

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

7 REPLIES 7
Super User IV
Super User IV

@NickProp28 , the formula seems fine. It is column check what value you have taken sum/min/max. Because on the color it will take aggregation.

You can also try a color measure and use that using "Field Value"

if it is a column

Color = IF(sum(SubBV[DiffDay])<=4, "Green", "Red")

It is measure
Color = IF([DiffDay]<=4, "Green", "Red")

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

https://exceleratorbi.com.au/dax-unichar-function-power-bi/
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Dear @amitchandak ,

Thanks for ur prompt response. Yes, i able to get the correct colour after change from sum to min.

But do you have any idea on my another question?
If Datediff less than or equal to 4 day will return false, while more than will be true.

And if datediff is blank, i do not want it to return anything. Just remain as blank.

But this DAX

True/False = IF(SubBV[DiffDay]<=4, "False", IF(SubBV[DiffDay]>=5, "True" )),
will return false if datediff is blank.
Appreciate your help.

@NickProp28 , for blank you can try like

Switch(true(),
isblank(SubBV[DiffDay]), blank(),
SubBV[DiffDay]<=4, "False"
SubBV[DiffDay]>=5 ,"True"
blank())

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Dear @amitchandak ,

 

I follow your code, but encounter error.

Here the pbix : https://ufile.io/sd52jjtx
Please take a look on the dataset.

 

Thanks for your help.

@NickProp28 , I think is happening because there multiple values job ID. so they adding up. I plotted it with unsummarized option and it worked 

Please find the attached file after signature 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Dear @amitchandak ,

 

In you pbix, 

NickProp28_0-1599459202199.png

Datediff still fall into 'false' categories. I would want if datediff is blank, in the True/false column remain blank. 
Is it possible to do it? I tried many ways but still categories in 'false'.

Appreciate your help.


@NickProp28 , I forgot My own suggested solution. Check now.

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors