<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Format a single cell in a Table (today) - Is this approach sensible? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974840#M11734</link>
    <description>&lt;P&gt;Nope, that's about the crux of it. Limited options given that conditional formatting only supports numeric values.&lt;/P&gt;</description>
    <pubDate>Sun, 15 Mar 2020 15:05:09 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-03-15T15:05:09Z</dc:date>
    <item>
      <title>Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974791#M11725</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First post here, but have been using Power BI for a little while now ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is about the validity of my approach. I'd appreciate any feedback about the approach and better / simpler was to achieve what I have done. For clarity, my solution works and achieves&amp;nbsp;the desired outcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data comes from Excel and is a record of my daily weight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Objective:&lt;/P&gt;&lt;P&gt;Identify today’s date cell in a table by applying conditional formatting (in my case I chose a tick mark)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Approach:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a measure containing the row date&lt;/LI&gt;&lt;LI&gt;Create a measure that compares the above measure with “Today()”&lt;/LI&gt;&lt;LI&gt;Apply conditional formatting to the table column “Date”&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;OL&gt;&lt;OL&gt;&lt;LI&gt;Create 1st measure:&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;Weight_Date = max('Weight_Data'[Date])​&lt;/LI-CODE&gt;&lt;OL&gt;&lt;OL&gt;&lt;LI&gt;Create 2nd measure:&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;Is Today = IF(DATEDIFF(TODAY(),Weight_Data[Weight_Date],DAY)=0,1,0)​&lt;/LI-CODE&gt;&lt;OL&gt;&lt;LI&gt;Apply formatting:&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;And here's the result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So what's the verdict? Is this the most elegant way to acheive my objective or am I missing a simple alternative?&lt;/P&gt;&lt;P&gt;Look forward to all comments!&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 13:37:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974791#M11725</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-15T13:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974840#M11734</link>
      <description>&lt;P&gt;Nope, that's about the crux of it. Limited options given that conditional formatting only supports numeric values.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 15:05:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974840#M11734</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T15:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974844#M11738</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Thanks for confirming that I wasn't being a complete numpty&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; It's always good to get confirmation that you're going along roughly the right tracks&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 15:15:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974844#M11738</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-15T15:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974848#M11740</link>
      <description>[Is Today] is NOT a measure. It's a calculated column. It could be written in a more compact way:&lt;BR /&gt;&lt;BR /&gt;[Is Today] = 1 * ( TODAY() = Weight_Data[Weight_Date] )&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;BR /&gt;</description>
      <pubDate>Sun, 15 Mar 2020 15:27:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974848#M11740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-15T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974874#M11753</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;That's EXACTLY what I was looking for! Such elegant code and presumably lighter on the system - Brilliant!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the DAX being a calculated column, is that "just" a terminology thing? Can you say why it's not a measure? I created it as a measure and it shows as a measure (and it might even taste like a measure&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_squinting_face:"&gt;😆&lt;/span&gt;) but I'm keen to ensure that my understanding is as complete as possible, so all info gladly received.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 16:39:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974874#M11753</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-15T16:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974880#M11754</link>
      <description>&lt;P&gt;A measure's value is calculated on demand and is fully dynamic; you can't slice by a measure (but you can filter by its values). A calculated column is a column in a model table and the values in it are calculated once - at load-time. You can then place the values in a slicer.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 16:50:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974880#M11754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-15T16:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974889#M11756</link>
      <description>&lt;P&gt;I hope we as a community are not going down the path of Perl in writing esoteric, unreadable code solely in the name of making things as short as possible...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 17:01:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974889#M11756</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T17:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974891#M11757</link>
      <description>I'd suggest, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;, you should check out most of your measures since they tend to be more complex than necessary most of the time.&lt;BR /&gt;&lt;BR /&gt;Last example can be found here: &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/DAX-to-facilitate-filters-whether-True-for-group-s-selected/m-p/974870/highlight/true#M11751" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/DAX-to-facilitate-filters-whether-True-for-group-s-selected/m-p/974870/highlight/true#M11751&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you compare it with my solution, you'll know immediately why you should not make such comments.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Sun, 15 Mar 2020 17:08:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974891#M11757</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-15T17:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974931#M11759</link>
      <description>&lt;P&gt;Ok, well, although I didn't intend to be controversial I can see that there are competing views here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started coding in around 1978 on a &lt;A href="https://en.wikipedia.org/wiki/Commodore_PET" target="_blank" rel="noopener"&gt;Commodore PET&lt;/A&gt;&amp;nbsp;and later progressed to a "&lt;A href="https://en.wikipedia.org/wiki/BBC_Micro" target="_self"&gt;BEEB&lt;/A&gt;". Both had very little memory and efficient coding (aka "Elegant" coding) has been my mantra ever since. I get pleasure from the petty enjoyment of finding the least code to achieve a given task. HOWEVER, there is a lot to be said for creating code that can be scan read by team members / future maintainers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, I expect that most coders would be able to sight read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Today = IF(DATEDIFF(TODAY(),Weight_Data[Weight_Date],DAY)=0,1,0)​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;more&amp;nbsp;&lt;SPAN&gt;intuitively&amp;nbsp;&lt;/SPAN&gt;than:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Today = 1 * (TODAY() = Weight_Data[Weight_Date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If for no other reason than the 2nd option relies on an understanding that &lt;EM&gt;False * 1&lt;/EM&gt; evaluates to 0 whereas &lt;EM&gt;True * 1&lt;/EM&gt; evaluates to 1 - "perhaps" not an instantly obvious detail.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, getting back to my code,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;you mention that, &lt;STRONG&gt;&lt;EM&gt;"A calculated column is a column in a model table"&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;, and I accept that, but I have to ask, if in my case you are saying that I &lt;STRONG&gt;&lt;EM&gt;should&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;change the [Is Today] calculation from being a measure into a calculated column or are you stating that [Is Today] &lt;STRONG&gt;&lt;EM&gt;is&lt;/EM&gt; &lt;/STRONG&gt;a calculated column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Incidentally, great heads-up about the ability to use a calculated column in a slicer where a measure can't be - Hadn't twigged that, but see it's truth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every day's a school day&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 18:21:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974931#M11759</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-15T18:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974936#M11760</link>
      <description>&lt;P&gt;I have just spent a fair amount of time drafting a response both to the question of code length and a supplementary&amp;nbsp;question about my original code but having posted it, i got:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what I did to incur the wrath&amp;nbsp;of the red pen brigade but just wanted you guys to know that I wasn't ignoring you ...&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 18:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974936#M11760</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-15T18:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974947#M11761</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215358" data-lia-user-login="BI_Curious" class="lia-mention lia-mention-user"&gt;BI_Curious&lt;/a&gt;&amp;nbsp; - Usually that only happens when you post things like 30 seconds apart or something like that. Odd.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/974947#M11761</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T19:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/976729#M11826</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a note to say that the admins have restored my "spam" comment ...&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 19:11:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/976729#M11826</guid>
      <dc:creator>BI_Curious</dc:creator>
      <dc:date>2020-03-16T19:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Format a single cell in a Table (today) - Is this approach sensible?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/976907#M11831</link>
      <description>Hi there. &lt;BR /&gt;&lt;BR /&gt;[Is Today] cannot be a measure in the current state because it does not use any kind of aggregation. The formula I gave you cannot therefore be a measure.&lt;BR /&gt;&lt;BR /&gt;But, of course, you can create a measure that will work the same on the date level but you have to define what it should return for any other level, for instance a month.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 16 Mar 2020 22:21:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-single-cell-in-a-Table-today-Is-this-approach-sensible/m-p/976907#M11831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-16T22:21:15Z</dc:date>
    </item>
  </channel>
</rss>

