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
NickProp28
Post Partisan
Post Partisan

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

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

 

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@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

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.

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 

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.

 

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.