<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pataree Ngamwongwan on Medium]]></title>
        <description><![CDATA[Stories by Pataree Ngamwongwan on Medium]]></description>
        <link>https://medium.com/@kibpat?source=rss-6df40581dfb6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SOX_ut969dS07a2O</url>
            <title>Stories by Pataree Ngamwongwan on Medium</title>
            <link>https://medium.com/@kibpat?source=rss-6df40581dfb6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:43:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kibpat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Conver to AEST — Date refresh]]></title>
            <link>https://medium.com/@kibpat/conver-to-aest-date-refresh-11c913437da3?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/11c913437da3</guid>
            <category><![CDATA[aest]]></category>
            <category><![CDATA[date-refresh]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[power-bi]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 05:24:00 GMT</pubDate>
            <atom:updated>2025-11-10T22:08:18.286Z</atom:updated>
            <content:encoded><![CDATA[<h3>Conver to AEST — Date refresh</h3><p>If the report need to show the date refresh in the correct time zone i.e. AEST</p><p>Create a function to convert the AEST</p><p>To create a function</p><ol><li>New Source -&gt; Blank Query from the rippon</li><li>Select Advance Editor from the rippon</li><li>Enter the code below in the advance editor dialogue and select done</li></ol><pre>//input of the function is called datetimecolumn and its type is datetime<br>(datetimecolumn as datetime) =&gt; <br>let<br>//define a variable called date as the date component of the datetimecolumn input<br>date = DateTime.Date(datetimecolumn),<br>//define a variable called time as the time component of the datetimecolumn input<br>time = DateTime.Time(datetimecolumn),<br> <br>//define the day that Day Light Saving Time starts as a variable called firstSundayOfOctober.<br>//this is the start of the week in which the 7th of October falls of the year we get from the input<br>firstSundayOfOctober = Date.StartOfWeek(#date(Date.Year(date), 10, 7), Day.Sunday),<br> <br>//define the day that Day Light Saving Time ends as a variable called firstSundayOfApril.<br>//this is the start of the week in which the 7th of April falls of the year we get from the input<br>firstSundayOfApril = Date.StartOfWeek(#date(Date.Year(date), 4, 7), Day.Sunday),<br> <br>//this gives us a boolean if the input date is in the day light saving DLS<br>isDayLightSavingTime =  <br>        (date = firstSundayOfOctober and time &gt;= #time(2,0,0)) //any time after 2am on the first Sunday in October<br>        or<br>        (date &gt; firstSundayOfOctober) //the date is after the first Sunday in October<br>        or<br>        (date &lt; firstSundayOfApril)  //the date is before the first Sunday in April<br>        or<br>        (date = firstSundayOfApril and time &gt;= #time(3,0,0)), //the date is on the first Sunday in April prior to 3am<br> <br>timeZone = 10 + Number.From(isDayLightSavingTime), //define timeZone as an integer that&#39;s 10 plus the numerical value of the boolean above<br>                                           // (1 for Day Light Saving time and 0 for Standard time) <br><br>//Australian Eastern Standard Time (AEST; UTC+10:00)<br>//Australian Eastern Daylight Time (AEDT; UTC+11:00)<br><br>AEST = DateTime.From(datetimecolumn) + #duration(0, timeZone, 0, 0) //take the original UTC date time and add the number of hours<br>                                                                    //in timeZone, 10 for standard time 11 for Day Light Saving Time<br>in<br>    AEST</pre><p>4. Select Add Column from the [Add Column] ribbon</p><p>5. Enter the new column name and select the function created above</p><p>6. Select the date time column that you need to convert from UTC time zone to AEST then invoke the function above</p><p>Example — using it in the last row</p><pre>let<br>    Source = &quot;&quot;,<br>    Custom1 = DateTimeZone.UtcNow(),<br>    #&quot;Converted to Table&quot; = #table(1, {{Custom1}}),<br>    #&quot;Renamed Columns&quot; = Table.RenameColumns(#&quot;Converted to Table&quot;,{{&quot;Column1&quot;, &quot;DateTime&quot;}}),<br>    #&quot;Duplicated Column&quot; = Table.DuplicateColumn(#&quot;Renamed Columns&quot;, &quot;DateTime&quot;, &quot;DateTime - Copy&quot;),<br>    #&quot;Duplicated Column1&quot; = Table.DuplicateColumn(#&quot;Duplicated Column&quot;, &quot;DateTime&quot;, &quot;DateTime - Copy.1&quot;),<br>    #&quot;Renamed Columns1&quot; = Table.RenameColumns(#&quot;Duplicated Column1&quot;,{{&quot;DateTime - Copy&quot;, &quot;Date&quot;}}),<br>    #&quot;Extracted Date&quot; = Table.TransformColumns(#&quot;Renamed Columns1&quot;,{{&quot;Date&quot;, DateTime.Date, type date}}),<br>    #&quot;Renamed Columns2&quot; = Table.RenameColumns(#&quot;Extracted Date&quot;,{{&quot;DateTime - Copy.1&quot;, &quot;Time&quot;}}),<br>    #&quot;Extracted Time&quot; = Table.TransformColumns(#&quot;Renamed Columns2&quot;,{{&quot;Time&quot;, DateTime.Time, type time}}),<br>    #&quot;Changed Type&quot; = Table.TransformColumnTypes(#&quot;Extracted Time&quot;,{{&quot;DateTime&quot;, type datetime}, {&quot;Date&quot;, type date}, {&quot;Time&quot;, type time}}),<br>    #&quot;Invoked Custom Function&quot; = Table.AddColumn(#&quot;Changed Type&quot;, &quot;Date_Refresh_Local&quot;, each #&quot;Convert To AEST&quot;([DateTime]))<br>in<br>    #&quot;Invoked Custom Function&quot;</pre><p>Quick summry steps for using a Custom Function:</p><ul><li><strong>Select the Data Source:</strong> Choose the query or table where you want to apply the function.</li><li><strong>Invoke Custom Function:</strong> Go to “Add Column” &gt; “Invoke Custom Function.”</li><li><strong>Configure:</strong></li><li><strong>New column name:</strong> Provide a name for the new column that will contain the function’s results.</li><li><strong>Function query:</strong> Select your custom function from the dropdown.</li><li><strong>Parameters:</strong> Map the function’s parameters to existing columns in your data source or provide fixed values.</li><li><strong>Apply:</strong> Click “OK” to add the new column with the function’s output.</li></ul><p>Reference:</p><ul><li><a href="https://willpage.dev/2020/06/26/converting-utc-to-new-zealand-time-in-m-power-query/">Converting UTC to New Zealand Time in M/Power Query</a></li><li><a href="https://community.fabric.microsoft.com/t5/Power-Query/Convert-Date-Time-in-UTC-to-Local-Time-with-Daylight-savings/m-p/790149#M26463">Re: Convert Date/Time in UTC to Local Time with Daylight savings</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11c913437da3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI Filter report by URL]]></title>
            <link>https://medium.com/@kibpat/power-bi-filter-report-by-url-a22833be5af2?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22833be5af2</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[url-filter]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Thu, 01 May 2025 05:24:28 GMT</pubDate>
            <atom:updated>2025-06-12T23:24:34.957Z</atom:updated>
            <content:encoded><![CDATA[<p>The power bi allow URL to filter the report</p><h4>Step 1 Create a page</h4><p>Just create a visual on your desktop</p><h4>Step 2 Create a report-level filter</h4><p>Create filters that you wish to pass the data dynamically in the URL at the report level</p><h4>Step 3 Get the report page URL</h4><p>After the report is published, in the address bar of your internet brower, copy the URL<br>It would look something like</p><p><a href="https://app.powerbi.com/groups/d877dd9d-c92e-4d5b-9bd1-31c24b3263d3/reports/a3e495ad-ce1a-45c5-9b67-44ce3ce151fa/643e6153c1008a61eb5c?experience=power-bi">https://app.powerbi.com/groups/&lt;some workspace number string&gt;/reports/&lt;some page number string&gt;?experience=power-bi</a></p><h4>Step 4 Get the URL filter syntax</h4><p>Remove the the [<a href="https://app.powerbi.com/groups/d877dd9d-c92e-4d5b-9bd1-31c24b3263d3/reports/a3e495ad-ce1a-45c5-9b67-44ce3ce151fa/643e6153c1008a61eb5c?experience=power-bi">experience=power-bi</a>] from the URL</p><p>Add filter based on this syntax — for more details please visit</p><p><a href="https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters">https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters</a></p><pre>URL?filter=Table/Field eq &#39;value&#39;</pre><p>The problem occurs if you have special characters in your table name and column name, please note both table name and column names are case-sensitive.</p><p>For example, I have a table called [Fact_Sales], then the table name is</p><pre>Fact_x005F_Sales</pre><p>Syntax of _x[UniChar]_ is used, in the case above _x005F_ is used to represent the underscore. The Unichar is 4 chars in length.</p><p>And I have a column name that is called [Sales Data], the column name is</p><pre>Sales_x0020_data</pre><p>Where _x[UniChar]_ is used, in the case above _x0020_ is used to replace space</p><p>Html Encoding</p><ul><li>%2F is forward slash</li><li>%20 is a space</li><li>%27 is a single quote</li></ul><p>Example before encoding</p><pre>URL?filter=Fact_Sales/Sales Data eq &#39;aProductName&#39;</pre><p>Example after encoding</p><pre>URL?filter=Fact_x005F_Sales%2FSales_x0020_Data%20eq%20%27aProductName%27</pre><p>if you have multiple selections, you may use in instead of eq (equal)</p><p>Example before encoding</p><pre>URL?filter=Fact_Sales/Sales Data in (&#39;value1&#39;, &#39;value2&#39;)</pre><p>Example after encoding</p><pre>URL?Fact_x005F_Sales%2FSales_x0020_Data%20in%20%40%27value1%27%44%20%27value2&#39;%41</pre><p>if you have multiple filters, you may add in the and</p><p>Example before encoding</p><pre>URL?filter=Fact_Sales%2FSales Data eq &#39;aProductName&#39; and Fact_Sales/Sales Lcation eq &#39;aLocationName&#39;</pre><p>Example after encoding</p><pre>URL?filter=Fact_x005F_Sales%2FSales_x0020_Data%20eq%20%27aProductName%27%20and%20Fact_x005F_Sales%2FSales_x0020_Location%20eq%20%27aLocationName%27</pre><h3><strong>NOTE:</strong></h3><p>For the report level filters, the report filters must include all when published for this to work, and cannot have preset values.</p><h4>For date, if you have a date range check the version using the URL first and make sure to remove Z at the end if it exists</h4><ul><li>OData V4 format: filter=Table/Date gt 2019–05–20</li><li>OData V3 format: filter=Table/Date gt datetime’2019–05–20T00:00:00&#39;</li></ul><p>Reference:</p><ul><li><a href="https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters">https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters</a></li><li><a href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URL-Filtering-not-working/m-p/3111531#M109942">https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/URL-Filtering-not-working/m-p/3111531#M109942</a></li><li><a href="https://www.w3schools.com/html/html_charset.asp">https://www.w3schools.com/html/html_charset.asp</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a22833be5af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI and Power Automate — Send email at the end of the month]]></title>
            <link>https://medium.com/@kibpat/power-bi-and-power-automate-send-email-at-the-end-of-the-month-7ee5a5eaa618?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ee5a5eaa618</guid>
            <category><![CDATA[end-of-month]]></category>
            <category><![CDATA[send-email]]></category>
            <category><![CDATA[power-automate-flow]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[power-automate]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Fri, 22 Nov 2024 00:44:35 GMT</pubDate>
            <atom:updated>2024-11-22T02:24:44.257Z</atom:updated>
            <content:encoded><![CDATA[<h3>Power BI and Power Automate — Send email at the end of the month</h3><p>If you have a published report and you want to send the email at the end of the month.</p><p>To do that go to power automate <a href="https://make.powerautomate.com/">https://make.powerautomate.com/</a></p><p>Then please read this article <a href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop">https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop</a> on how to create this scheduled cloud flow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*g1pTvfIOFcRI-A2U0uObWw.png" /></figure><p>Now the part that I want to show is how to send at the end of the month</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*0DdEx0QCTKKFWDRSwtiVqA.png" /></figure><h3>Recurrence</h3><p>Set this to run on a daily basis at the time of your choice</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*XI3HdOIHwyomMbih7YV43A.png" /></figure><h3>Today — Start of Month</h3><p>Add an action after Recurrence</p><p>Select Compose</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*jGYaz_Hhxb2spY_nEpPU8g.png" /></figure><p>Select Function</p><p>Use Search bar to look for startOfMonth, then utcNow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_xp5hdtUUpdOFAu3f6cgPQ.png" /></figure><p>The Formula for the Compose — which is renamed to [Today Start of the Month] is</p><pre>startOfMonth(utcNow())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*ED7t2SJmH0e7tlnxuR2yig.png" /></figure><h3>Tomorrow Start of Month</h3><p>Add an action after [Today Start of Month] compose action</p><p>Similar action the the previous step Select Compose</p><p>Select Function</p><p>Use Search bar to look for startOfMonth, addDays, then utcNow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDyT4vct8rM7pOoHyvIFdQ.png" /></figure><p>The Formula for the Compose — which is renamed to [Tomorrow Start of the Month] is</p><pre>startOfMonth(addDays(utcNow(), 1))</pre><h3>Add Action — Condition</h3><p>Condition — End of Month if Today Start of Month and Tomorrow Start of the Month is not the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*Ss5MMlt_Wue47gZ6AQJQnA.png" /></figure><p>By selecting the output of Today Start of Month and out of Tomorrow Start of Month in the previous steps.</p><h3>TRUE <strong>EOM example</strong>:</h3><ul><li><strong>Today Start of the Month for 30th Nov:</strong> 1st November</li><li><strong>Tomorrow Start of Month for 1st Dec: </strong>1st December (by adding one day to today’s date)</li><li><strong>Conclusion:</strong> 1st November != 1st December</li></ul><h3>FALSE EOM example:</h3><ul><li><strong>Today Start of the Month for 15th Nov: </strong>1st November</li><li><strong>Tomorrow Start of Month for 16th Nov:</strong> 1st November ((by adding one day to today’s date)</li><li><strong>Conclusion:</strong> 1st November (15 Nov) == 1st November (16th Nov)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*As85wlEB6wVP3wnf6CtdOw.png" /></figure><p>Based on the requirement, add additional actions to either [TRUE] or [FALSE] as required.</p><h3>Tip: Export to File for Power Reports</h3><p>Under Advanced parameters</p><p>If only required a certain page to be sent out as attachment</p><p>Page name is not the Page or Sheet Name but the a part of the URL.</p><p>Example URL:<br><a href="https://app.powerbi.com/groups/d877dd9d-c92e-4d5b-9bd1-31c24b3263d3/reports/ba5d34df-3a46-4fe7-8ff3-cc0e388b919d/f38d622d699346beb9b3?experience=power-bi">https://app.powerbi.com/groups/&lt;some long string&gt;/&lt;another some long string before question mark&gt;?experience=power-bi</a></p><p>The page name is the <a href="https://app.powerbi.com/groups/d877dd9d-c92e-4d5b-9bd1-31c24b3263d3/reports/ba5d34df-3a46-4fe7-8ff3-cc0e388b919d/f38d622d699346beb9b3?experience=power-bi">&lt;another some long string before question mark&gt;</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*AchSd_RNCqaLD1ymmlJdzw.png" /></figure><p>Parameter for Include Hidden pages may need to be selected as No</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*lrL3OBgsEd09whjxoiNwWw.png" /></figure><h3>Reference:</h3><p><a href="https://make.powerautomate.com/">https://make.powerautomate.com/</a></p><p><a href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop">https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop</a></p><p><a href="https://youtu.be/sNZXxJ-QrIE?si=jpIwp1krnqE4k_Hn">https://youtu.be/sNZXxJ-QrIE?si=jpIwp1krnqE4k_Hn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ee5a5eaa618" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI Selected Parameters and Drill through]]></title>
            <link>https://medium.com/@kibpat/power-bi-selected-parameters-and-drill-through-6e7fdee8cad6?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e7fdee8cad6</guid>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 04:07:21 GMT</pubDate>
            <atom:updated>2024-10-18T04:07:21.526Z</atom:updated>
            <content:encoded><![CDATA[<p>To get selected values of your parameters to be used in your dynamic title</p><p>Create your parameters in Power BI, and select the fields or columns you want</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*bQGA3wwXE1v_-5_qIh4z3Q.png" /></figure><p>The new parameter is created, in this example using 4 fields or columns<br>Code automatically generated by Power BI</p><pre>ReportParam = {<br>    (&quot;Color Name&quot;, NAMEOF(&#39;Fake Data&#39;[Color Name]), 0),<br>    (&quot;Group&quot;, NAMEOF(&#39;Fake Data&#39;[Group]), 1),<br>    (&quot;HEX&quot;, NAMEOF(&#39;Fake Data&#39;[HEX]), 2),<br>    (&quot;Type&quot;, NAMEOF(&#39;Fake Data&#39;[Type]), 3)<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*9TwgzM97I57WqIVRbElDiA.png" /></figure><p>Then go to table view</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/67/1*3tRgx8TZs02gGaz8Gb61BQ.png" /></figure><p>Create an additional column, basically reference the first column of the parameter table</p><pre>ReportParam MeasureName = ReportParam[ReportParam]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9zYVut_7YAMVlOVCp0T3Q.png" /></figure><p>Back to Report view</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/48/1*LJCpz589t8EAfyz-FeeE2A.png" /></figure><p>Create a new measure, in this example, a dynamic title will display a parameter that is selected or display text</p><pre>parameter dynamic title = &quot;Dual Color Scheme by &quot; <br>&amp; SELECTEDVALUE(&#39;ReportParam&#39;[ReportParam MeasureName], &quot;multiple selection&quot;)</pre><p>Now you can use this new measure as part of your dynamic tile</p><p>In the format pane, select this icon and select the [parameter dynamic title] created in the earlier example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*dSH1kZPVh9TC1cI5JcuW8w.png" /></figure><p>Result in something like this if you use it in a table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*1amMV2--wCAbu8ixmxw9eg.png" /></figure><p>To create a Drill-through based on the selected row</p><p>Create a new measure to reference the new column created in parameter table</p><pre>SelectedParam = SELECTEDVALUE(&#39;ReportParam&#39;[ReportParam MeasureName])</pre><p>Now create a new page, select the page type as drill through and use the [SelectedParam] measure as your drill through from</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*cMTLke30b_p_0jN9RVvlrQ.png" /></figure><p>Back to the table that has used parameters add the [SelectedParam] measure field as a column and change the name. In this example, I just change the name to [Drill through Param]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*c4j-otyknNY9mMQR9uJ--g.png" /></figure><p>Here is how this example now looks like. The top bit is parameter slicer and the table that have parameter noOfRows and then our drill through measure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*NmbENr9BaZ_kXLReTAQVnw.png" /></figure><p>If right click on the drill through param, you will go to the test page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*4HL3jXZzEaSblyyZF8dZuA.png" /></figure><p>On the drill-through page, depends on how you set up the page, but here is a very simple table to show that it works (based on BLUE group) selected before drill through</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*QiuGEONHwToaPA3jBbgy1g.png" /></figure><p>I did a very rough and quick example, so hope it is easy enough to follow along</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e7fdee8cad6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI Different Current Month and Previous Month]]></title>
            <link>https://medium.com/@kibpat/power-bi-different-current-month-and-previous-month-12c7a4c745f1?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/12c7a4c745f1</guid>
            <category><![CDATA[previous-month]]></category>
            <category><![CDATA[current-month]]></category>
            <category><![CDATA[difference]]></category>
            <category><![CDATA[power-bi]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 03:08:53 GMT</pubDate>
            <atom:updated>2025-03-05T22:18:14.843Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes you might want to show a comparison between the previous month and the current month</p><p>Create a measure for the current month</p><pre>SumForAMeasure = SUM( TableName[FieldName])</pre><p>Then you can create another measure for the previous month, reference the measure above</p><pre>SumForAMeasure_PrevMonth = CALCULATE( [SumForAMeasure]<br>                           , PREVIOUSMONTH(DateTable[DateField]))</pre><p>Now that you have it, you can create the diff between the current month and the previous month</p><p>Note: the BLANK() is to not show the first-month diff in the table</p><pre>DiffCurrMonthPrevMonth = <br>var __movement = [SumForAMeasure] - [SumForAMeasure_PrevMonth]<br>return if ( __movement = [SumForAMeasure], BLANK(), __movement)</pre><p>See the result in the table for</p><p>[ Date, SumForAMeasure, DiffCurrMonthPrevMonth]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*cudMRG4Bu7Xg9dkIBZMB1Q.png" /><figcaption>Diff is the last column</figcaption></figure><p>Note: the number might not be 100% accurate in the image due to rounding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12c7a4c745f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Selection display]]></title>
            <link>https://medium.com/@kibpat/multiple-selection-display-335a3c5f1eea?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/335a3c5f1eea</guid>
            <category><![CDATA[concatenatex]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[values]]></category>
            <category><![CDATA[mulitple-selection]]></category>
            <category><![CDATA[dax]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 02:57:40 GMT</pubDate>
            <atom:updated>2024-06-12T06:06:47.184Z</atom:updated>
            <content:encoded><![CDATA[<p>Depending on what are selected in the slicer, we want to display the data differently</p><p>Calculate how many there are in a column, remove all filters</p><pre>count_all = CALCULATE(DISTINCTCOUNT(TableName[FiledName]), ALL() )</pre><p>or if there is another slicer that could impact the count all, then put in that filter</p><pre>count_all_with_filter = CALCULATE(DISTINCTCOUNT(TableName[FiledName]),FILTERS(TableName[SlicerFildName]) )</pre><p>Calculate how many selected</p><pre>count_selected = COUNTROWS(VALUES(TableName[FiledName]))</pre><p>Now put them into a field to check if the [count_all] = [count_selected], this mean that [All] were selected.</p><p>Display the values selected using CONCATENATEX</p><pre>concat_selected = CONCATENATEX(VALUES(TableName[FiledName]), [FiledName], &quot;,&quot;)</pre><p>If there are less than 2 selected in the slicer, then display the values selected, Otherwise, show [Multiple Selection]</p><p>Here is the completed code: two versions</p><p>Clear all filter</p><pre>Var _count_all = CALCULATE(DISTINCTCOUNT(TableName[FiledName]), ALL() )<br>Var _count_selected = COUNTROWS(VALUES(TableName[FiledName]))<br>Var _concat_selected = CONCATENATEX(VALUES(TableName[FiledName]), [FiledName], &quot;,&quot;)<br>RETURN if ( _count_selected= _count_all, &quot;All&quot; , if (_count_selected&gt; 2, &quot;Multiple Selection&quot;, _concat_selected))</pre><p>Has one filter</p><pre><br>Var _count_all_with_filter = CALCULATE(DISTINCTCOUNT(TableName[FiledName]),FILTERS(TableName[SlicerFildName]) )<br>Var _count_selected = COUNTROWS(VALUES(TableName[FiledName]))<br>Var _concat_selected = CONCATENATEX(VALUES(TableName[FiledName]), [FiledName], &quot;,&quot;)<br>RETURN if ( _count_selected= _count_all_with_filter, &quot;All&quot; , if (_count_selected&gt; 2, &quot;Multiple Selection&quot;, _concat_selected))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=335a3c5f1eea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI add empty characters]]></title>
            <link>https://medium.com/@kibpat/power-bi-add-empty-characters-3f056cf433d5?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f056cf433d5</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[empty-space]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 01:37:42 GMT</pubDate>
            <atom:updated>2024-06-12T01:37:42.810Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a few ways to do this</p><ol><li>Using space on your keyword</li><li>Go to <a href="https://emptycharacter.com/">Empty Characters, Whitespaces &amp; Blank Unicode Characters</a> then copy and paste it</li><li>Using Unicode: U+0020</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f056cf433d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Min and Max of a selected Date Range]]></title>
            <link>https://medium.com/@kibpat/getting-min-and-max-of-a-selected-date-range-0c73d539323c?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c73d539323c</guid>
            <category><![CDATA[mịn]]></category>
            <category><![CDATA[date]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[max]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Tue, 11 Jun 2024 23:23:39 GMT</pubDate>
            <atom:updated>2024-06-11T23:23:39.949Z</atom:updated>
            <content:encoded><![CDATA[<p>How do I get Min and Max of the selected Date Ranged</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*iEtxzSXZWZ9yaVj_-_99HA.png" /></figure><p>By using MINX and MAXX DAX function, you can get the selected dates in the slicer</p><pre>MINX(ALLSELECTED(tableName), tableName[DATE])</pre><pre>MAXX(ALLSELECTED(tableName), tableName[DATE])</pre><p>Let’s say, you want to calculate all dates before the MIN and MAX and see the difference</p><pre>Amount_Start = <br>var _dateStart = MINX(ALLSELECTED(tableName), tableName[DATE])<br>return Calculate ( sum(tableName[AMOUNT])<br>                    , tableName[DATE] &lt;= _dateStart <br>                )</pre><pre>Amount_End = <br>var _dateEnd = MAXX(ALLSELECTED(tableName), tableName[DATE])<br>return Calculate ( sum(tableName[AMOUNT])<br>                    , tableName[DATE] &lt;= _dateEnd<br>                )</pre><p>Then now you can see the difference.</p><pre>Amount_Diff = [Amount_End] - [Amount_Start]</pre><p>Alternatively, those can all be combined into one field</p><pre>Amount_Diff =<br>var _dateStart = MINX(ALLSELECTED(tableName), tableName[DATE])<br>var _AmountStart = Calculate( sum(tableName[AMOUNT])<br>                              , tableName[DATE] &lt;= _dateStart <br>                  )<br><br>var _dateEnd = MAXX(ALLSELECTED(tableName), tableName[DATE])<br>var _AmountEnd = Calculate ( sum(tableName[AMOUNT])<br>                            , tableName[DATE] &lt;= _dateEnd<br>                  )<br><br>return (_AmountEnd - _AmountStart)</pre><p>Or if you want to get the amount within the selected date range, it can also be done in a similar manner</p><pre>Amount Within Selected Time Period = <br><br>var _dateStart = MINX(ALLSELECTED(tableName), tableName[DATE])<br>var _dateEnd = MAXX(ALLSELECTED(tableName), tableName[DATE])<br><br><br>var _AmountEnd = Calculate ( sum(tableName[AMOUNT])<br>                            , tableName[DATE] &gt;= _dateStart<br>                            , tableName[DATE] &lt;= _dateEnd<br>                  )<br><br>return _AmountEnd<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c73d539323c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power Bi Date with Null Date Filter and Date selection]]></title>
            <link>https://medium.com/@kibpat/power-bi-date-with-null-date-filter-250b9f81715a?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/250b9f81715a</guid>
            <category><![CDATA[null]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[date]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 01:07:46 GMT</pubDate>
            <atom:updated>2024-06-05T01:13:51.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I thought about how the NULL date can be displayed if given a Date Slicer option</p><p>Create the date slicer for the user to select the date range</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*WwR99_KfBdHvxlc14XhKPg.png" /><figcaption>Date Slicer for the user to select the range</figcaption></figure><p>If only date slicer is displayed, all the null dates in closed date will not display as null dates won’t be part of that range</p><p>To overcome this issue, create a hidden date slicer</p><p>Create a hidden slicer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*IKGUgtYkcy7e-0UY0oqNGA.png" /><figcaption>Filer for the Closed Date</figcaption></figure><p>The filer for date is Null or Blank (so that null values will not be removed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*pDLD_y4YelovBE_evUktOw.png" /></figure><p>Open the selection, then hide it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*us9bWpEHCqFjZB8vuxuq0g.png" /></figure><p>Now the NULL date would also be displayed regardless of the date selections from the users</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=250b9f81715a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power BI Dax Error]]></title>
            <link>https://medium.com/@kibpat/power-bi-dax-error-7ca653d4c08f?source=rss-6df40581dfb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ca653d4c08f</guid>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[error]]></category>
            <dc:creator><![CDATA[Pataree Ngamwongwan]]></dc:creator>
            <pubDate>Thu, 09 May 2024 23:36:38 GMT</pubDate>
            <atom:updated>2024-05-09T23:36:38.784Z</atom:updated>
            <content:encoded><![CDATA[<p>This may or may not work</p><pre>a measure = len(ColumnName)</pre><p>The syntax above might give you an error like</p><p>[a single value for column ‘…’ in table ‘..’ cannot be determined</p><p>this can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count or sum to get a single value]</p><p>If that is the case try</p><pre>a measure = len (selectedvalue(ColumnName))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ca653d4c08f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>