<?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 power bi table visual by adding a condition to show value exceedance in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1642358#M33378</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this working with some forum searching and getting a helping hand in reformatting my code and approach. Posting this for the benifit of others struggling with a similar problem.&lt;/P&gt;&lt;P&gt;My approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created two measures&lt;/P&gt;&lt;P&gt;one to select the row value from fact table A which I called FactValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FactValue&lt;EM&gt; = SELECTEDVALUE(Fact_A[RD_VALUE])&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two to compare the value with the lookup value from a Dimension Table of chemicals "B" where Limits column is the lookup value.&lt;/P&gt;&lt;P&gt;Here I used ISBlank to elminate the rows that dont have any look up value( only certain chemicals have these limits)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Exceedence =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR Y = [FactValue] // I am referencing my first measure here&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR X =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(ISBLANK(Y), BLANK (), SELECTEDVALUE (Table_B[LIMITS]) )&lt;FONT color="#0000FF"&gt;// Checks if the lookup dimension has a limit value, if yes then return the result as 1 or 0//&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR Result =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (ISBLANK (X)||X = 0, BLANK (), IF ( Y &amp;gt; X, 1, 0 ) ) &lt;FONT color="#0000FF"&gt;//Check if the given value is &amp;gt; than the Limit value//&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESULT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my final result in a formatted table with out the use of calculated columns. This approach works best if you have relationships built in your model&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;img /&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 15:22:49 GMT</pubDate>
    <dc:creator>Basmall_B</dc:creator>
    <dc:date>2021-02-03T15:22:49Z</dc:date>
    <item>
      <title>Format a power bi table visual by adding a condition to show value exceedance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1630166#M33025</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a power bi table visual which has columns from two tables. I have to work with data that I am pulling from a SQL server analysis cube so adding calculated columns is not an option for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What&amp;nbsp; I am trying to achieve is to create a measure that I can bring into the table whether the value exceeds the set limit or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a measure to the right of the visual to show if the "Value" column exceeds the "limit" column. if it does it should return a '1". The "Value " column is coming from Table B and the Limits is coming from Table A . There is a one to many relation built between these tables in the tabluar model. The measure condition should be to run the conditional check&amp;nbsp; &amp;nbsp;against the "Limit"&amp;nbsp; value if available. If that column is empty nothing should be returned&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is&amp;nbsp; my table visual&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I played with the following DAX formula but I can only show the value in a card when I click on a single&amp;nbsp; value .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Exceedence =&lt;BR /&gt;VAR X =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Table A[Limits]),&lt;BR /&gt;FILTER(Table A,Table A[RD_NAMEKEY] = SELECTEDVALUE(Table A[RD_NAMEKEY]))&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;SELECTEDVALUE(Fact_TableB[RD_VALUE]) &amp;gt; X,&lt;BR /&gt;1,0&lt;BR /&gt;)&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Could some one help me where I am going wrong in my approach or is this even the right approach?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 22:22:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1630166#M33025</guid>
      <dc:creator>Basmall_B</dc:creator>
      <dc:date>2021-01-28T22:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Format a power bi table visual by adding a condition to show value exceedance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1632887#M33096</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;I am pulling from a SQL server analysis cube so adding calculated columns is not an option for me"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That is no longer a restriction - change your connection from live to direct query.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 01:05:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1632887#M33096</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-30T01:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Format a power bi table visual by adding a condition to show value exceedance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1633936#M33146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response. I should have been more clear when i said "Adding a calculated column is not an option"In my scenario I dont maintain the cube and our DBA team is pretty strict on what we can do and can't do. They recomend to work with a live connection as the data gets updated almost weekly. And for visuals they insist that I only use a measure where possible. The code I attached works in the context of the visual; only when I click on a row and show the measure on a card. What I would like is to show the same measure as a column inside the table visual. When I add it as a measure column in the visual it just&amp;nbsp; sits there showing a spinning wheel on the top showing it is trying to do something. May be my syntax is not correct. Can you suggest if I need to change something in the syntax. I am not an expert in DAX . What our I do is through help from the forum and YouTube videos. Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 14:30:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1633936#M33146</guid>
      <dc:creator>Basmall_B</dc:creator>
      <dc:date>2021-01-31T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Format a power bi table visual by adding a condition to show value exceedance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1642358#M33378</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this working with some forum searching and getting a helping hand in reformatting my code and approach. Posting this for the benifit of others struggling with a similar problem.&lt;/P&gt;&lt;P&gt;My approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created two measures&lt;/P&gt;&lt;P&gt;one to select the row value from fact table A which I called FactValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FactValue&lt;EM&gt; = SELECTEDVALUE(Fact_A[RD_VALUE])&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two to compare the value with the lookup value from a Dimension Table of chemicals "B" where Limits column is the lookup value.&lt;/P&gt;&lt;P&gt;Here I used ISBlank to elminate the rows that dont have any look up value( only certain chemicals have these limits)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Exceedence =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR Y = [FactValue] // I am referencing my first measure here&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR X =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(ISBLANK(Y), BLANK (), SELECTEDVALUE (Table_B[LIMITS]) )&lt;FONT color="#0000FF"&gt;// Checks if the lookup dimension has a limit value, if yes then return the result as 1 or 0//&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR Result =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (ISBLANK (X)||X = 0, BLANK (), IF ( Y &amp;gt; X, 1, 0 ) ) &lt;FONT color="#0000FF"&gt;//Check if the given value is &amp;gt; than the Limit value//&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESULT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my final result in a formatted table with out the use of calculated columns. This approach works best if you have relationships built in your model&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;img /&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 15:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Format-a-power-bi-table-visual-by-adding-a-condition-to-show/m-p/1642358#M33378</guid>
      <dc:creator>Basmall_B</dc:creator>
      <dc:date>2021-02-03T15:22:49Z</dc:date>
    </item>
  </channel>
</rss>

