Forum Discussion

Lucian's avatar
Lucian
Icon for Responsive Resident rankResponsive Resident
2 years ago
Solved

Bug or else?: Conditional formatting as URL isn't working for some rows (show items with no data)

Hello,

 

I have an issue using conditional formatting using "Web URL" option. I have a table with some information, and one of the field is an URL to that specific item. What I need is to format a topic/subject field based on that URL field, but is not always working.

The issue is 100% reproductible, so I try to explain what I did.

 

1. Let's assume the following TestTable:

 

 

For simplicity of the test, I have also put the M code that will generate it:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTQMzDUMzIwMlHSUQoxMDAEUanFJQru+fnpOakKoUE+QBFDAwMgmVFSUlBspa+fDpbSS87PVYrVwTTCCGaEU2ZeOtQAJN1JQFGEXkNUvcYwvcEFqakpWG0vLy/XKwbJlgDV6eWllugrxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Number = _t, Topic = _t, Amount = _t, URL = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Number", type text}, {"Topic", type text}, {"Amount", Int64.Type}, {"URL", type text}})
in
    #"Changed Type"

 

2. I have created a simple table visual displaying the fields of the table, just to make sure all of them are visible/ok.

3. I have used "Conditional formatting"/"Web URL" on Topic field and everyting is ok except on rows that don't have an "amount" and I have displayed them using "Show items with no data" on the Date field.

 

So, the question is possible to have the Topic field formatted with that URL even if no amount?

 

In the real scenario, that table contains information that should help the viewer to navigate through that URL and check some details related with that item that not always have an "amount".

And because of the usage - the URL column will not be displayed, just used in formatting the Topic column.

 

Kind Regards,

Lucian

  • Hi Lucian 

    Interesting.

    What if to add +0 to your measure (or create it, if you use implicit one):

    Sum of Amount = SUM(Table[Amount]) + 0

     

4 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi Lucian 

    Interesting.

    What if to add +0 to your measure (or create it, if you use implicit one):

    Sum of Amount = SUM(Table[Amount]) + 0

     

    • Lucian's avatar
      Lucian
      Icon for Responsive Resident rankResponsive Resident

      Hi az38 ,

       

      And thank you for your quick response.

      Indeed, creating a measure and adding that "+0" at the end will do the expected formatting 🤔.

      Even I don't understand why Microsoft decided to ignore the formatting from the beginning... but I think I have to use your workaround. 😁

      So thank  you very much.

       

      Kind Regards,

      Lucian

  • josef78's avatar
    josef78
    Icon for Memorable Member rankMemorable Member

    It is Bug
    In Power BI Table visuals, Web URL conditional formatting fails to apply on rows that are displayed solely due to the "Show items with no data" option. If any measure is used (implicit or explicit) and all measures on a row are blank, the row is rendered, but the URL formatting is ignored—as if the row didn’t exist. This happens regardless of whether the URL is a column or a measure.

     

    Workaround:
    The issue can be bypassed by either adding any measure that always returns a non-blank value (e.g., a total count, first non-blank URL, etc.), or by creating a dummy measure like HideMe = "" and hiding it visually (e.g., setting column width to zero). This forces Power BI to treat the row as valid for formatting. However, this is still just a workaround and not a proper solution.