<?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>TMDL Gallery topics</title>
    <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/bd-p/pbi_tmdlgallery</link>
    <description>TMDL Gallery topics</description>
    <pubDate>Thu, 03 Dec 2026 00:09:07 GMT</pubDate>
    <dc:creator>pbi_tmdlgallery</dc:creator>
    <dc:date>2026-12-03T00:09:07Z</dc:date>
    <item>
      <title>Top N Calculation Group: N slider, configurable column, Top/Bottom N, Others, Share, Rank</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Top-N-Calculation-Group-N-slider-configurable-column-Top-Bottom/m-p/5377127#M21</link>
      <description>&lt;P&gt;A generic Top N calculation group, based on a pattern &lt;STRONG&gt;Martin Bubenheimer&lt;/STRONG&gt; showed in his session: a calculation item "Top 5 Kunden nach Umsatz" that ranks the members of the current selection by SELECTEDMEASURE() and keeps only the top 5. All credit for the idea goes to Martin.&lt;/P&gt;&lt;P&gt;What this script adds:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;N comes from a numeric range parameter 'Top N Count' (1 to 50, default 5)&lt;/LI&gt;&lt;LI&gt;The ranked column is configured once, in the DAX user-defined function Ranking.Apply at the top of the script. The calculation group ranks whichever listed column is on the visual.&lt;/LI&gt;&lt;LI&gt;Five items: Top N, Bottom N (skips members without values), Others, Top N Share and Rank (ties like TOPN)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Before you apply it:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Compatibility level 1702 or higher (DAX user-defined functions)&lt;/LI&gt;&lt;LI&gt;Model property "Discourage implicit measures" = On, otherwise the calculation group is rejected&lt;/LI&gt;&lt;LI&gt;Replace 'Geography'[ZipCountry] in Ranking.Apply with your own column(s), most detailed first&lt;/LI&gt;&lt;LI&gt;Change precedence 20 if another calculation group already uses it&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PBIX with a synthetic test model, the script and a README on GitHub: https://github.com/KornAlexander/PBI-Tools/tree/main/TMDL%20Repo/Top%20N%20Calculation%20Group&lt;/P&gt;&lt;P&gt;Tested in Power BI Desktop with a synthetic model. Two lessons from that test: a function namespace must not start like a built-in function (TopN.Apply is read as TOPN and can never be called), and a parameter must not be named value (VALUE is a DAX function).&lt;/P&gt;&lt;PRE&gt;createOrReplace

	/// ===== CONFIGURATION: the only object you need to edit =====
	/// Lists the columns the Top N calculation group can rank. The first column that is on the visual axis wins,
	/// so list the most detailed column first (Customer before Country). The last line is the default column,
	/// used on cards, grand totals and visuals without a listed column.
	/// A column NOT listed here is not ranked: its rows show the Top N of the default column instead.
	/// Grand totals always use the default column, so with a Country &amp;gt; Customer hierarchy the total is the top N of the default column.
	/// Requires compatibility level 1702 or higher (DAX user-defined functions).
	/// Pattern credit: Martin Bubenheimer (Top 5 Kunden nach Umsatz, DIAD Foundation).
	function 'Ranking.Apply' = ```
			(
			    mode : STRING,
			    measureValue : SCALAR EXPR
			) =&amp;gt;
			VAR _N = SELECTEDVALUE ( 'Top N Count'[Top N Count], 5 )
			RETURN
			    SWITCH (
			        TRUE (),
			        // ----- rankable columns, most detailed first: ISINSCOPE ( &amp;lt;column&amp;gt; ), Ranking.Core ( mode, &amp;lt;column&amp;gt;, measureValue, _N ),
			        ISINSCOPE ( 'Geography'[ZipCountry] ), Ranking.Core ( mode, 'Geography'[ZipCountry], measureValue, _N ),
			        // ISINSCOPE ( 'Product'[Product] ), Ranking.Core ( mode, 'Product'[Product], measureValue, _N ),
			        // ----- default column for cards and grand totals
			        Ranking.Core ( mode, 'Geography'[ZipCountry], measureValue, _N )
			    )
			```

	/// Top N engine for any column and any measure. No need to edit.
	/// mode: "Top", "Bottom", "Others", "Share" or "Rank".
	/// Ties: TOPN keeps all members tied at position N, so "Top 5" can show 6 or more members.
	/// Pattern credit: Martin Bubenheimer (Top 5 Kunden nach Umsatz, DIAD Foundation).
	function 'Ranking.Core' = ```
			(
			    mode : STRING,
			    col : COLUMNREF,
			    measureValue : SCALAR EXPR,
			    n : INT64
			) =&amp;gt;
			-- Pattern: Martin Bubenheimer, "Top 5 Kunden nach Umsatz" (DIAD Foundation)
			-- Generalized: any column via COLUMNREF, N from the 'Top N Count' slider
			VAR _Members =
			    CALCULATETABLE ( VALUES ( col ), ALLSELECTED ( col ) )
			VAR _Top =
			    TOPN ( n, _Members, CALCULATE ( measureValue ), DESC )
			RETURN
			    SWITCH (
			        mode,
			        "Top",
			            CALCULATE ( measureValue, KEEPFILTERS ( _Top ) ),
			        "Bottom",
			            VAR _NonBlank = FILTER ( _Members, NOT ISBLANK ( CALCULATE ( measureValue ) ) )
			            RETURN
			                CALCULATE ( measureValue, KEEPFILTERS ( TOPN ( n, _NonBlank, CALCULATE ( measureValue ), ASC ) ) ),
			        "Others",
			            CALCULATE ( measureValue, KEEPFILTERS ( EXCEPT ( _Members, _Top ) ) ),
			        "Share",
			            IF (
			                NOT ( ISINSCOPE ( col ) &amp;amp;&amp;amp; ISBLANK ( measureValue ) ),
			                DIVIDE ( CALCULATE ( measureValue, _Top ), CALCULATE ( measureValue, ALLSELECTED ( col ) ) )
			            ),
			        "Rank",
			            IF (
			                ISINSCOPE ( col ) &amp;amp;&amp;amp; NOT ISBLANK ( measureValue ),
			                RANKX ( ALLSELECTED ( col ), CALCULATE ( measureValue ), , DESC, SKIP )
			            )
			    )
			```

	/// Top N slider value for the 'Top N' calculation group. Default 5 when nothing or several values are selected.
	/// Pattern credit: Martin Bubenheimer (Top 5 Kunden nach Umsatz, DIAD Foundation).
	table 'Top N Count'

		measure 'Top N Count Value' = SELECTEDVALUE ( 'Top N Count'[Top N Count], 5 )
			formatString: 0

		column 'Top N Count'
			dataType: int64
			formatString: 0
			summarizeBy: none
			sourceColumn: [Value]

			extendedProperty ParameterMetadata =
					{
					  "version": 0
					}

		partition 'Top N Count' = calculated
			mode: import
			source = GENERATESERIES ( 1, 50, 1 )

	/// Generic Top N calculation group: works with any measure and every column listed in function Ranking.Apply.
	/// N comes from the 'Top N Count' slider (default 5).
	/// Precedence must be unique per model: change 20 if another calculation group already uses it.
	/// The model must have "Discourage implicit measures" = On (Model properties), otherwise the calculation group is rejected.
	/// Pattern credit: Martin Bubenheimer (Top 5 Kunden nach Umsatz, DIAD Foundation).
	table 'Top N'

		calculationGroup
			precedence: 20

			/// Measure value only for the top N members of the ranked column inside the current selection. Total = sum of the top N.
			calculationItem 'Top N' = Ranking.Apply ( "Top", SELECTEDMEASURE () )
				ordinal: 0

			/// Measure value only for the bottom N members that have a value (blanks are excluded before ranking).
			calculationItem 'Bottom N' = Ranking.Apply ( "Bottom", SELECTEDMEASURE () )
				ordinal: 1

			/// Measure value for all members outside the top N. Total = "Others" amount for a card or a stacked total.
			calculationItem 'Others' = Ranking.Apply ( "Others", SELECTEDMEASURE () )
				ordinal: 2

			/// Share of the top N in the selected total, for example "Top 5 customers = 92 % of sales". Same value on every row of the ranked column that has a value.
			calculationItem 'Top N Share' = Ranking.Apply ( "Share", SELECTEDMEASURE () )
				ordinal: 3

				formatStringDefinition = "0.0 %"

			/// Rank of the current member inside the selection (1 = highest, SKIP ties like TOPN). Blank on the total row.
			calculationItem 'Rank' = Ranking.Apply ( "Rank", SELECTEDMEASURE () )
				ordinal: 4

				formatStringDefinition = "0"

		column 'Top N'
			dataType: string
			summarizeBy: none
			sourceColumn: Name
			sortByColumn: Ordinal

		column Ordinal
			dataType: int64
			isHidden
			summarizeBy: none
			sourceColumn: Ordinal&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2026 09:42:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Top-N-Calculation-Group-N-slider-configurable-column-Top-Bottom/m-p/5377127#M21</guid>
      <dc:creator>AlexanderKornMS</dc:creator>
      <dc:date>2026-10-26T09:42:17Z</dc:date>
    </item>
    <item>
      <title>Refresh Date/ Time: Auto swich between BST &amp; GMT</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Refresh-Date-Time-Auto-swich-between-BST-amp-GMT/m-p/4878604#M20</link>
      <description>&lt;P&gt;A table that uses DateTime.LocalNow() to dynamically change the time from BST to GMT and vice versa.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table Refresh_DateTime

		column RefreshDate
			dataType: dateTime
			formatString: General Date
			summarizeBy: none
			sourceColumn: RefreshDate

			annotation SummarizationSetBy = Automatic

		column Local_Date_Time
			dataType: dateTime
			formatString: dd/mm/yy hh:nn
			summarizeBy: none
			sourceColumn: Local_Date_Time

			annotation SummarizationSetBy = Automatic

			annotation PBI_FormatHint = {"isCustom":true}

		partition Refresh_DateTime = m
			mode: import
			source = ```
					let
					    Source = #table(type table[RefreshDate=datetime], {{DateTime.LocalNow()}}),
					    Test = #table(type table[RefreshDate=datetime], {{#datetime(2026,10,25,11,0,0)}}),
					  // To test, change the "Source" reference to "Test"
					  AddBST = Table.AddColumn(Source, "Local_Date_Time", each 
					        let
					            dt = [RefreshDate],
					            year = Date.Year(dt),
					            dstStart = Date.StartOfWeek(#date(year, 3, 31), Day.Sunday),
					            dstEnd = Date.StartOfWeek(#date(year, 10, 31), Day.Sunday),
					            isDST = Date.From(dt) &amp;gt;= dstStart and Date.From(dt) &amp;lt; dstEnd,
					            offset = if isDST then 1 else 0,
					            bstTime = dt + #duration(0, offset, 0, 0)
					        in
					            bstTime,
					        type datetime
					    )
					in
					    AddBST
					```

		annotation PBI_NavigationStepName = Navigation

		annotation PBI_ResultType = Table
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 12:45:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Refresh-Date-Time-Auto-swich-between-BST-amp-GMT/m-p/4878604#M20</guid>
      <dc:creator>Duh</dc:creator>
      <dc:date>2025-11-18T12:45:10Z</dc:date>
    </item>
    <item>
      <title>Create a Multi-Parameter Table for Thematic Filtering in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Create-a-Multi-Parameter-Table-for-Thematic-Filtering-in-Power/m-p/4852455#M18</link>
      <description>&lt;P&gt;This script creates a ‘Multi Parameter’ table in Power BI that allows you to filter on a single parameter and return up to four associated field references (columns or measures).&lt;BR /&gt;With this approach, you can group related fields into thematic sets, making it easy to synchronize multiple visuals on a report page to a specific topic or analytical perspective.&lt;/P&gt;&lt;P&gt;A key consideration is that the order of the fields must be preserved, otherwise Power BI will not correctly recognize the parameter structure.&lt;/P&gt;&lt;P&gt;This technique is ideal for creating flexible, topic-based dashboards where multiple visuals respond to a unified filter context.&lt;/P&gt;&lt;P&gt;Learn more about adapting field parameters to your project here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters" target="_blank"&gt;https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;createOrReplace

	table 'Multi Parameter'
		lineageTag: bcdcaa89-6654-44ce-9eb9-0679c7b99e4b

		column 'Parameter 4'
			lineageTag: f9032c01-9dfe-4e07-b83a-f531869235a4
			summarizeBy: none
			sourceColumn: [Value8]
			sortByColumn: 'Parameter Order'

			relatedColumnDetails
				groupByColumn: 'Parameter Fields 4'

			annotation SummarizationSetBy = Automatic

		column 'Parameter 3'
			lineageTag: f9032c01-9dfe-4e07-b83a-f531869235a3
			summarizeBy: none
			sourceColumn: [Value6]
			sortByColumn: 'Parameter Order'

			relatedColumnDetails
				groupByColumn: 'Parameter Fields 3'

			annotation SummarizationSetBy = Automatic

		column 'Parameter 2'
			lineageTag: f9032c01-9dfe-4e07-b83a-f531869235a2
			summarizeBy: none
			sourceColumn: [Value4]
			sortByColumn: 'Parameter Order'

			relatedColumnDetails
				groupByColumn: 'Parameter Fields 2'

			annotation SummarizationSetBy = Automatic

		column 'Parameter 1'
			lineageTag: f9032c01-9dfe-4e07-b83a-f531869235a1
			summarizeBy: none
			sourceColumn: [Value1]
			sortByColumn: 'Parameter Order'

			relatedColumnDetails
				groupByColumn: 'Parameter Fields 1'

			annotation SummarizationSetBy = Automatic

		column 'Parameter Fields 1'
			isHidden
			lineageTag: 61e451b3-f5d5-497e-94cd-3f763efbdd41
			summarizeBy: none
			sourceColumn: [Value2]
			sortByColumn: 'Parameter Order'

			extendedProperty ParameterMetadata = {"version":3,"kind":2}

			annotation SummarizationSetBy = Automatic

		column 'Parameter Fields 2'
			isHidden
			lineageTag: 61e451b3-f5d5-497e-94cd-3f763efbdd42
			summarizeBy: none
			sourceColumn: [Value5]
			sortByColumn: 'Parameter Order'

			extendedProperty ParameterMetadata = {"version":3,"kind":2}

			annotation SummarizationSetBy = Automatic

		column 'Parameter Fields 3'
			isHidden
			lineageTag: 61e451b3-f5d5-497e-94cd-3f763efbdd43
			summarizeBy: none
			sourceColumn: [Value7]
			sortByColumn: 'Parameter Order'

			extendedProperty ParameterMetadata = {"version":3,"kind":2}

			annotation SummarizationSetBy = Automatic

		column 'Parameter Fields 4'
			isHidden
			lineageTag: 61e451b3-f5d5-497e-94cd-3f763efbdd44
			summarizeBy: none
			sourceColumn: [Value9]
			sortByColumn: 'Parameter Order'

			extendedProperty ParameterMetadata = {"version":3,"kind":2}

			annotation SummarizationSetBy = Automatic

		column 'Parameter Order'
			isHidden
			formatString: 0
			lineageTag: 8425d3f0-fb91-458d-97c8-b0e3c3acce97
			summarizeBy: sum
			sourceColumn: [Value3]

			annotation SummarizationSetBy = Automatic

		column 'Parameter Filter'
			lineageTag: f9032c01-9dfe-4e07-b83a-f53186923566
			summarizeBy: none
			sourceColumn: [Value10]
			sortByColumn: 'Parameter Order'

			annotation SummarizationSetBy = Automatic

		partition Parameter = calculated
			mode: import
			source =
					{
					    ("Customer", NAMEOF('Customer'[Customer]), 0, "Company", NAMEOF('Customer'[Company]), "Country Name", NAMEOF('Customer'[Country Name]), "Occupation", NAMEOF('Customer'[Occupation]), "Customer"),
					    ("Product", NAMEOF('Product'[Product]), 1, "Category Name", NAMEOF('Product'[Category Name]), "Manufacturer", NAMEOF('Product'[Manufacturer]), "Brand", NAMEOF('Product'[Brand]), "Product")
					}

		annotation PBI_Id = 327d5af8295f4794bec0a018ecba78f0
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 06:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Create-a-Multi-Parameter-Table-for-Thematic-Filtering-in-Power/m-p/4852455#M18</guid>
      <dc:creator>mwegener</dc:creator>
      <dc:date>2025-10-17T06:09:10Z</dc:date>
    </item>
    <item>
      <title>PQ Function - Calendar Table by Lars Schreiber</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/PQ-Function-Calendar-Table-by-Lars-Schreiber/m-p/4798100#M16</link>
      <description>&lt;P&gt;This German Power Query Function will create a CalendarTable with a fixed start and end range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of characterlimit here is the TMDL script:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/KornAlexander/PBI-Tools/blob/main/TMDL%20Repo/PQ%20Function%20-%20Calendar%20by%20Lars%20Schreiber.txt" target="_blank"&gt;PBI-Tools/TMDL Repo/PQ Function - Calendar by Lars Schreiber.txt at main · KornAlexander/PBI-Tools&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See more info from Lars about the topic in his blog here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://ssbi-blog.de/blog/business-topics/meine-projekterprobte-kalendertabelle-fuer-power-bi-und-power-pivot/" target="_blank"&gt;Meine projekterprobte Kalendertabelle für Power BI und Power Pivot | THE SELF-SERVICE-BI BLOG&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 14:14:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/PQ-Function-Calendar-Table-by-Lars-Schreiber/m-p/4798100#M16</guid>
      <dc:creator>alexanderkorn</dc:creator>
      <dc:date>2025-08-15T14:14:05Z</dc:date>
    </item>
    <item>
      <title>Calc Table - Calendar</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calc-Table-Calendar/m-p/4798025#M15</link>
      <description>&lt;DIV&gt;&lt;P&gt;This table is a fairly simple Calc Calendar Table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- With AUTOCALENDAR&lt;/P&gt;&lt;P&gt;- With 1 FiscalYear column&lt;/P&gt;&lt;P&gt;- With Favorites Folder&lt;/P&gt;&lt;P&gt;- Splitting into Display Folders Text and Number Columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table CalcCalendar
		dataCategory: Time

		column Date
			isKey
			formatString: Short Date
			displayFolder: 1. Favorites
			summarizeBy: none
			isNameInferred
			sourceColumn: [Date]

			annotation SummarizationSetBy = Automatic

			annotation UnderlyingDateTimeDataType = Date

		column Month
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Month]

			annotation SummarizationSetBy = Automatic

		column 'Fiscal Year'
			formatString: 0
			displayFolder: 3. Fiscal Date\2. Numbers;1. Favorites
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Fiscal Year]

			annotation SummarizationSetBy = Automatic

		column Year
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns;1. Favorites
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Year]

			annotation SummarizationSetBy = Automatic

		column 'Month (MMM)'
			displayFolder: 2. Calendar Date\3. Text Columns;1. Favorites
			summarizeBy: none
			isNameInferred
			sourceColumn: [Month (MMM)]
			sortByColumn: Month

			annotation SummarizationSetBy = Automatic

		column Day
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Day]

			annotation SummarizationSetBy = Automatic

		column 'Is Before This Month'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Before This Month]

			annotation SummarizationSetBy = Automatic

		column 'Is Current Fiscal Year'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Current Fiscal Year]

			annotation SummarizationSetBy = Automatic

		column 'Is Previous Fiscal Year'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Previous Fiscal Year]

			annotation SummarizationSetBy = Automatic

		column 'Is Current Calendar Year'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Current Calendar Year]

			annotation SummarizationSetBy = Automatic

		column 'Is Previous Calendar Year'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Previous Calendar Year]

			annotation SummarizationSetBy = Automatic

		column 'Is Current Month'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Current Month]

			annotation SummarizationSetBy = Automatic

		column 'Is Previous Month'
			formatString: """TRUE"";""TRUE"";""FALSE"""
			displayFolder: 4. Flags
			summarizeBy: none
			isNameInferred
			sourceColumn: [Is Previous Month]

			annotation SummarizationSetBy = Automatic

		column 'Year Month Key'
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: count
			sourceColumn: [Month Key]

			annotation SummarizationSetBy = Automatic

		column 'Relative Month'
			formatString: 0
			displayFolder: 4. Flags
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Relative Month]

			annotation SummarizationSetBy = Automatic

		column Quarter
			displayFolder: 2. Calendar Date\3. Text Columns
			summarizeBy: none
			isNameInferred
			sourceColumn: [Quarter]

			annotation SummarizationSetBy = Automatic

		column 'End of Month'
			formatString: General Date
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: none
			isNameInferred
			sourceColumn: [End of Month]

			annotation SummarizationSetBy = Automatic

		column 'Week of Year'
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Week of Year]

			annotation SummarizationSetBy = Automatic

		column Weekday
			formatString: 0
			displayFolder: 2. Calendar Date\2. Number Columns
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Weekday]

			annotation SummarizationSetBy = Automatic

		column 'Is Current or Past Months'
			displayFolder: 4. Flags
			summarizeBy: none
			sourceColumn: [Is Current or Past Month]

			annotation SummarizationSetBy = Automatic

		hierarchy 'Date Hierarchy'
			displayFolder: 2. Calendar Date\1. Hierarchy

			level Year
				column: Year

			level Month
				column: Month

			level Date
				column: Date

		hierarchy 'Fiscal Date Hierarchy'
			displayFolder: 3. Fiscal Date\1. Hierarchy

			level 'Fiscal Year'
				column: 'Fiscal Year'

		hierarchy 'Calendar Hierarchy'
			displayFolder: 1. Favorites

			level Year
				column: Year

			level 'Month (MMM)'
				column: 'Month (MMM)'

		partition CalcCalendar = calculated
			mode: import
			source = ```
					
					VAR Today = TODAY()  -- Modify for testing
					VAR MonthStartFiscalYear = 10
					RETURN
					    ADDCOLUMNS(
					        /*CALENDAR(        
					            DATE ( 2022, 1, 1 ),
					            DATE ( 2027, 1, 1 )), */ --use it if CALENDARAUTO is not an option
					        CALENDARAUTO(),
					        "Year",YEAR([Date]),
					        "Quarter", "Q "&amp;amp;QUARTER([Date]),
					        "Month", MONTH([Date]),
					        "Month (MMM)", FORMAT([Date], "MMM"),
					        "Day",DAY([Date]),
					        "Fiscal Year", YEAR([Date]) + IF(MONTH([Date]) &amp;gt;= MonthStartFiscalYear, 1, 0),
					        "End of Month", EOMONTH([Date], 0),
					        "Week of Year", WEEKNUM([Date]),
					        "Weekday", WEEKDAY([Date]),
					
					        "Is Current or Past Month", IF([Date] &amp;lt;= EOMONTH(TODAY(), 0), "Yes", "No"),
					        "Is Before This Month",FORMAT([Date],"YYYYMM")&amp;lt;FORMAT(Today,"YYYYMM"),
					
					        -- Current/Previous Fiscal Year flags
					        "Is Current Fiscal Year", 
					        VAR CurrentFiscalYear = YEAR(Today) + IF(MONTH(Today) &amp;gt;= MonthStartFiscalYear, 1, 0)
					        RETURN YEAR([Date]) + IF(MONTH([Date]) &amp;gt;= MonthStartFiscalYear, 1, 0) = CurrentFiscalYear,
					
					        "Is Previous Fiscal Year",
					        VAR CurrentFiscalYear = YEAR(Today) + IF(MONTH(Today) &amp;gt;= MonthStartFiscalYear, 1, 0)
					        RETURN YEAR([Date]) + IF(MONTH([Date]) &amp;gt;= MonthStartFiscalYear, 1, 0) = CurrentFiscalYear - 1,
					
					        -- Current/Previous Calendar Year flags
					        "Is Current Calendar Year", YEAR([Date]) = YEAR(Today),
					        "Is Previous Calendar Year", YEAR([Date]) = YEAR(Today) - 1,
					
					        -- Current/Previous Month flags
					        "Is Current Month", 
					        YEAR([Date]) = YEAR(Today) &amp;amp;&amp;amp; MONTH([Date]) = MONTH(Today),
					
					        "Is Previous Month",
					        VAR PrevMonthYear = IF(MONTH(Today) = 1, YEAR(Today) - 1, YEAR(Today))
					        VAR PrevMonth = IF(MONTH(Today) = 1, 12, MONTH(Today) - 1)
					        RETURN YEAR([Date]) = PrevMonthYear &amp;amp;&amp;amp; MONTH([Date]) = PrevMonth,
					        -- Month Key (YYYYMM format)
					        "Month Key",
					        YEAR([Date]) * 100 + MONTH([Date]),
					        -- Relative Month (0 = current month, negative = past, positive = future)
					        "Relative Month",
					        (YEAR([Date]) - YEAR(Today)) * 12 + (MONTH([Date]) - MONTH(Today))
					    )
					  
					```

		annotation TabularEditor_TableGroup = 03. Dimension Tables&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 13:34:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calc-Table-Calendar/m-p/4798025#M15</guid>
      <dc:creator>alexanderkorn</dc:creator>
      <dc:date>2025-08-15T13:34:44Z</dc:date>
    </item>
    <item>
      <title>Table Groups (Folders for your table)</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Table-Groups-Folders-for-your-table/m-p/4795254#M14</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I was missing 𝗧𝗮𝗯𝗹𝗲 𝗚𝗿𝗼𝘂𝗽𝘀 (Tabular Editor 3 Feature) and structure of tables in Power BI Desktop, so I've decided to finally prioritize the time to figure out how to do it 𝙙𝙮𝙣𝙖𝙢𝙞𝙘𝙖𝙡𝙡𝙮 𝙬𝙞𝙩𝙝 𝙄𝙉𝙁𝙊.𝙑𝙄𝙀𝙒 functions and some basic rule specifications.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Table Group DAX'

		/// COUNTROWS('Table Group DAX')
		measure 'Number of tables' = COUNTROWS('Table Group DAX')
			formatString: 0
			displayFolder: Measures

		column Type
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Type]

			annotation SummarizationSetBy = Automatic

		column 'Table Name'
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Table Name]

			annotation SummarizationSetBy = Automatic

		column Description
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Description]

			annotation SummarizationSetBy = Automatic

		column Order
			formatString: 0
			displayFolder: Numeric
			summarizeBy: none
			isNameInferred
			sourceColumn: [Order]

			annotation SummarizationSetBy = User

		partition 'Table Group DAX' = calculated
			mode: import
			source = ```
					-- DAX Script to create table group like information automated using INFO.VIEW DAX functions--
					-- Credit to David Kofod Hanna --
					-- LinkedIn https://www.linkedin.com/in/davidkofod/ --
					-- 11th April 2025--

					// Define the name of this table to avoid self-reference
					VAR _ThisTableName = "Table Group DAX"

					//
					// FIELD PARAMETERS TABLES
					//
					VAR _FieldParameters =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES(),
					            CONTAINSSTRING([Expression], "NAMEOF") &amp;amp;&amp;amp;
					            [Name] &amp;lt;&amp;gt; _ThisTableName
					        ),
					        "Type", "Field Parameters",
					        "Table Name", [Name],
					        "Description", "Dynamic switch between measure or attributes",
					        "Order", 5
					    )

					//
					// NUMERIC PARAMETERS
					//
					VAR _NumericParameter =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES(),
					            CONTAINSSTRING([Expression], "GENERATE") &amp;amp;&amp;amp;
					            [Name] &amp;lt;&amp;gt; _ThisTableName
					        ),
					        "Type", "Numeric Parameter",
					        "Table Name", [Name],
					        "Description", "Dynamic slider for end users to select",
					        "Order", 6
					    )

					//
					// CALCULATION GROUPS
					//
					VAR _CalculationGroup =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES(),
					            [CalculationGroupPrecedence] &amp;gt;= 1 &amp;amp;&amp;amp;
					            [Name] &amp;lt;&amp;gt; _ThisTableName
					        ),
					        "Type", "Calculation Group",
					        "Table Name", [Name],
					        "Description", "Dynamic calculation items",
					        "Order", 4
					    )

					//
					// DOCUMENTATION TABLES
					//
					VAR _ModelDoc =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES(),
					            CONTAINSSTRING([Expression], "INFO.VIEW") &amp;amp;&amp;amp;
					            [Name] &amp;lt;&amp;gt; _ThisTableName
					        ),
					        "Type", "Model Documentation",
					        "Table Name", [Name],
					        "Description", "Documentation with INFO.VIEW functions",
					        "Order", 7
					    )

					//
					// FACT TABLES (many side of relationship)
					//
					VAR _Fact =
					    DISTINCT(
					        SELECTCOLUMNS(
					            INFO.VIEW.RELATIONSHIPS(),
					            "Type", "Fact",
					            "Table Name", [FromTable],
					            "Description", "Fact with many-side relationship",
					            "Order", 2
					        )
					    )

					//
					// DIMENSION TABLES (one side of relationship)
					//
					VAR _Dim =
					    DISTINCT(
					        SELECTCOLUMNS(
					            INFO.VIEW.RELATIONSHIPS(),
					            "Type", "Dimension",
					            "Table Name", [ToTable],
					            "Description", "Dimension with one-side relationship",
					            "Order", 3
					        )
					    )

					//
					// GET LIST OF ALL TABLES ALREADY CLASSIFIED ABOVE
					//
					VAR _AllDefinedTables =
					    UNION(
					        SELECTCOLUMNS(_FieldParameters, "Table Name", [Table Name]),
					        SELECTCOLUMNS(_NumericParameter, "Table Name", [Table Name]),
					        SELECTCOLUMNS(_CalculationGroup, "Table Name", [Table Name]),
					        SELECTCOLUMNS(_ModelDoc, "Table Name", [Table Name]),
					        SELECTCOLUMNS(_Fact, "Table Name", [Table Name]),
					        SELECTCOLUMNS(_Dim, "Table Name", [Table Name])
					    )

					//
					// GET ALL MODEL TABLES (excluding this one)
					//
					VAR _AllTables =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES(),
					            [Name] &amp;lt;&amp;gt; _ThisTableName
					        ),
					        "Table Name", [Name]
					    )

					//
					// FIND UNCLASSIFIED TABLES (implied as MEASURE GROUPS)
					//
					VAR _MeasureGroups =
					    EXCEPT(_AllTables, _AllDefinedTables)

					VAR _RemainingMeasureGroups =
					    SELECTCOLUMNS(
					        _MeasureGroups,
					        "Type", "Measure Group",
					        "Table Name", [Table Name],
					        "Description", "Classified as Measure Group",
					        "Order", 1
					    )

					//
					// FINAL UNION OF ALL TABLE GROUP TYPES
					//
					VAR _Result =
					    UNION(
					        _FieldParameters,
					        _NumericParameter,
					        _CalculationGroup,
					        _ModelDoc,
					        _Fact,
					        _Dim,
					        _RemainingMeasureGroups
					    )

					RETURN
					    _Result
				```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 06:49:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Table-Groups-Folders-for-your-table/m-p/4795254#M14</guid>
      <dc:creator>davidkofodhanna</dc:creator>
      <dc:date>2025-08-13T06:49:41Z</dc:date>
    </item>
    <item>
      <title>Calculation group for dynamic date</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calculation-group-for-dynamic-date/m-p/4795240#M13</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"𝗚𝗶𝘃𝗲 𝗺𝗲 𝗮𝗻 𝗲𝗮𝘀𝘆 𝗼𝗽𝘁𝗶𝗼𝗻 𝘁𝗼 𝘀𝘄𝗶𝘁𝗰𝗵 𝗱𝗮𝘁𝗲 𝗽𝗲𝗿𝗶𝗼𝗱𝘀 &amp;amp; 𝘾𝙪𝙨𝙩𝙤𝙢 𝙙𝙖𝙩𝙚𝙨"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":calendar:"&gt;📅&lt;/span&gt; Let's make it userfriendly and with a click of a button - the end user can set predefined date slicers + 𝘴𝘵𝘪𝘭𝘭 𝘨𝘪𝘷𝘦 𝘵𝘩𝘦𝘮 𝘵𝘩𝘦 𝘰𝘱𝘵𝘪𝘰𝘯 𝘰𝘧 𝘢 𝘤𝘶𝘴𝘵𝘰𝘮 𝘥𝘢𝘵𝘦 𝘳𝘢𝘯𝘨𝘦.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;All done with 𝗰𝗮𝗹𝗰𝘂𝗹𝗮𝘁𝗶𝗼𝗻 𝗴𝗿𝗼𝘂𝗽𝘀 𝘁𝗼 𝘁𝗵𝗲 𝗿𝗲𝘀𝗰𝘂𝗲 and with some 𝙛𝙞𝙡𝙩𝙚𝙧𝙨&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;𝘾𝙧𝙚𝙙𝙞𝙩: If I remember correctly, I saw a trick on this custom date range slicer years ago from&lt;/SPAN&gt; &lt;A href="https://www.linkedin.com/company/bi-elite-llc/" target="_self"&gt;&lt;SPAN&gt;BI Elite&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;!&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Let DAX tell the story...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Date Slicer'

		calculationGroup
			precedence: 1

			calculationItem 'Last 30 Days' = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR _Day = 30
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            KEEPFILTERS(
					                DATESINPERIOD( 'Date'[Date], TODAY( ), -_Day, DAY )
					            )
					        )
					    )
					RETURN
					    __Result

			calculationItem 'Last 3 Months' = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR _Day = 90
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            KEEPFILTERS(
					                DATESINPERIOD( 'Date'[Date], TODAY( ), -_Day, DAY )
					            )
					        )
					    )
					RETURN
					    __Result

			calculationItem 'Last 6 Months' = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Day = 180
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            KEEPFILTERS(
					                DATESINPERIOD( 'Date'[Date], TODAY( ), -__Day, DAY )
					            )
					        )
					    )
					RETURN
					    __Result

			calculationItem 'Current Year' = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            KEEPFILTERS( DATESYTD( 'Date'[Date] ) )
					        )
					    )
					RETURN
					    __Result

			calculationItem 'Last Year' = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            KEEPFILTERS(
					                SAMEPERIODLASTYEAR( DATESYTD( 'Date'[Date] ) )
					            )
					        )
					    )
					RETURN
					    __Result

			calculationItem All = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            REMOVEFILTERS( 'Date'[Date] )
					        )
					    )
					RETURN
					    __Result

			calculationItem Custom = 
					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            REMOVEFILTERS( 'Date'[Date] )
					        )
					    )
					RETURN
					    __Result

		measure 'Date period' = MIN('Date'[Date]) &amp;amp; " - " &amp;amp; MAX('Date'[Date])

		measure 'Filter Date Slicer Custom' = IF( SELECTEDVALUE ('Date Slicer'[Date slicer column] ) = "Custom", 1, 0 )
			formatString: 0

		measure 'Title Custom Date Slicer State' = 

				IF(
				    SELECTEDVALUE('Date Slicer'[Date slicer column]) = "Custom",
				    "Choose a custom date range",
				    "Custom selection disabled")

		column 'Date slicer column'
			dataType: string
			sourceColumn: Name
			sortByColumn: Ordinal

		column Ordinal
			dataType: int64
			isHidden
			sourceColumn: Ordinal&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Aug 2025 06:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calculation-group-for-dynamic-date/m-p/4795240#M13</guid>
      <dc:creator>davidkofodhanna</dc:creator>
      <dc:date>2025-08-13T06:41:43Z</dc:date>
    </item>
    <item>
      <title>Calculation Group for dynamic weeks</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calculation-Group-for-dynamic-weeks/m-p/4795233#M12</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"𝗚𝗶𝘃𝗲 𝗺𝗲 𝗮𝗻 𝗲𝗮𝘀𝘆 𝗼𝗽𝘁𝗶𝗼𝗻 𝘁𝗼 𝘀𝘄𝗶𝘁𝗰𝗵 🅦🅔🅔🅚🅢"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":calendar:"&gt;📅&lt;/span&gt; Let's make it userfriendly and with a click of a button - the end user can set predefined date slicers.&lt;/SPAN&gt; &lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;All done with 𝗰𝗮𝗹𝗰𝘂𝗹𝗮𝘁𝗶𝗼𝗻 𝗴𝗿𝗼𝘂𝗽𝘀 𝘁𝗼 𝘁𝗵𝗲 𝗿𝗲𝘀𝗰𝘂𝗲 and with help from the extended date table by&lt;/SPAN&gt; &lt;SPAN&gt;Melissa de Korte&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for some OFFSET columns to assist us with weeks and easier DAX.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Let DAX tell the story...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Week Date Slicer'

		calculationGroup
			precedence: 2

			calculationItem 'Current Week' = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _Week =
					    MAX('Date'[CurrWeekOffset])
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE (
					            SELECTEDMEASURE (),
					            KEEPFILTERS(
					                'Date'[CurrWeekOffset] = _Week
					            )
					        )
					    )
					RETURN
					    _Result

			calculationItem LW = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _MaxWeek = CALCULATE(MAX('Date'[CurrWeekOffset]), 'Date'[WeekCompleted] = TRUE)
					VAR _Week =
					    MAX('Date'[CurrWeekOffset]) - 1
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE (
					            SELECTEDMEASURE (),
					            KEEPFILTERS(
					                'Date'[CurrWeekOffset] &amp;gt;= _Week &amp;amp;&amp;amp; 'Date'[CurrWeekOffset] &amp;lt;= _MaxWeek
					            )
					        )
					    )
					RETURN
					    _Result

			calculationItem L2W = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _MaxWeek = CALCULATE(MAX('Date'[CurrWeekOffset]), 'Date'[WeekCompleted] = TRUE)
					VAR _Week =
					    MAX('Date'[CurrWeekOffset]) - 2
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE (
					            SELECTEDMEASURE (),
					            KEEPFILTERS(
					                'Date'[CurrWeekOffset] &amp;gt;= _Week &amp;amp;&amp;amp; 'Date'[CurrWeekOffset] &amp;lt;= _MaxWeek
					            )
					        )
					    )
					RETURN
					    _Result

			calculationItem L4W = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _MaxWeek = CALCULATE(MAX('Date'[CurrWeekOffset]), 'Date'[WeekCompleted] = TRUE)
					VAR _Week =
					    MAX('Date'[CurrWeekOffset]) - 4
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE (
					            SELECTEDMEASURE (),
					            KEEPFILTERS(
					                'Date'[CurrWeekOffset] &amp;gt;= _Week &amp;amp;&amp;amp; 'Date'[CurrWeekOffset] &amp;lt;= _MaxWeek
					            )
					        )
					    )
					RETURN
					    _Result

			calculationItem L12W = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _MaxWeek = CALCULATE(MAX('Date'[CurrWeekOffset]), 'Date'[WeekCompleted] = TRUE)
					VAR _Week =
					    MAX('Date'[CurrWeekOffset]) - 12
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE (
					            SELECTEDMEASURE (),
					            KEEPFILTERS(
					                'Date'[CurrWeekOffset] &amp;gt;= _Week &amp;amp;&amp;amp; 'Date'[CurrWeekOffset] &amp;lt;= _MaxWeek
					            )
					        )
					    )
					RETURN
					    _Result

			calculationItem All = 

					VAR _Isdatesfiltered =
					    CALCULATE ( ISFILTERED ( 'Date'[Date] ), ALLSELECTED () )
					VAR _Result =
					    IF (
					        _Isdatesfiltered,
					        SELECTEDMEASURE (),
					        CALCULATE ( SELECTEDMEASURE (), REMOVEFILTERS ( 'Date'[Date] ) )
					    )
					RETURN
					    _Result

			calculationItem Custom = 

					VAR __Isdatesfiltered =
					    CALCULATE( ISFILTERED( 'Date'[Date] ), ALLSELECTED( ) )
					VAR __Result =
					    IF(
					        __Isdatesfiltered,
					        SELECTEDMEASURE( ),
					        CALCULATE(
					            SELECTEDMEASURE( ),
					            REMOVEFILTERS( 'Date'[Date] )
					        )
					    )
					RETURN
					    __Result

		measure 'Date period' = MIN('Date'[Date]) &amp;amp; " - " &amp;amp; MAX('Date'[Date])

		measure 'Filter Date Slicer Custom' = IF( SELECTEDVALUE ('Week Date Slicer'[Week Date] ) = "Custom", 1, 0 )
			formatString: 0

		measure 'Title Custom Date Slicer State' = 

				IF(
				    SELECTEDVALUE('Week Date Slicer'[Week Date]) = "Custom",
				    "Choose a custom date range",
				    "Custom selection disabled")

		measure 'Week period' = MIN('Date'[Week &amp;amp; Year]) &amp;amp; " - " &amp;amp; MAX('Date'[Week &amp;amp; Year])

		column 'Week Date'
			dataType: string
			sourceColumn: Namea
			sortByColumn: Ordinal

		column Ordinal
			dataType: int64
			isHidden
			sourceColumn: Ordinal&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Aug 2025 06:38:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calculation-Group-for-dynamic-weeks/m-p/4795233#M12</guid>
      <dc:creator>davidkofodhanna</dc:creator>
      <dc:date>2025-08-13T06:38:26Z</dc:date>
    </item>
    <item>
      <title>Last Refresh Semantic Model (Power Query)</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Last-Refresh-Semantic-Model-Power-Query/m-p/4795225#M11</link>
      <description>&lt;LI-CODE lang="markup"&gt;createOrReplace

	/// Last refresh of semantic model - not the underlying job and pipelines
	table 'Last Refresh'
		column TimeStamp
			dataType: dateTime
			formatString: d mmm yyyy hh.nn
			displayFolder: Dates
			summarizeBy: none
			sourceColumn: TimeStamp

			annotation SummarizationSetBy = Automatic

			annotation PBI_FormatHint = {"isDateTimeCustom":true}

		column 'Date Last Refresh'
			dataType: dateTime
			formatString: Long Date
			displayFolder: Dates
			summarizeBy: none
			sourceColumn: Date Last Refresh

			annotation SummarizationSetBy = Automatic

			annotation UnderlyingDateTimeDataType = Date

		column 'Time Last Refresh'
			dataType: dateTime
			formatString: Long Time
			displayFolder: Dates
			summarizeBy: none
			sourceColumn: Time Last Refresh

			annotation SummarizationSetBy = Automatic

			annotation UnderlyingDateTimeDataType = Time

		partition 'Last Refresh' = m
			mode: import
			queryGroup: 'Meta Data &amp;amp; Organize'
			source =
					/* M-Query - Data Last Refreshed */
					
					let
					    SummerTime = Date.StartOfWeek( #date(Date.Year( DateTime.LocalNow() ), 3, 31) , Day.Sunday ),
					    WinterTime = Date.StartOfWeek( #date(Date.Year( DateTime.LocalNow() ), 10, 31) , Day.Sunday ),
					    CurrentDateTime = DateTimeZone.RemoveZone( DateTimeZone.UtcNow() ),
					    TimeShiftFromUTC = if CurrentDateTime &amp;lt; SummerTime &amp;amp; #time( 2, 0, 0) or CurrentDateTime &amp;gt; WinterTime &amp;amp; #time( 2, 0, 0) then 1 else 2,
					    TimeStamp = DateTimeZone.SwitchZone( DateTimeZone.UtcNow(), TimeShiftFromUTC, 0),
					    #"Converted to Table" = #table(1, {{TimeStamp}}),
					    #"Renamed Column1 to TimeStamp" = Table.RenameColumns(#"Converted to Table",{{"Column1", "TimeStamp"}}),
					    #"Changed Type TimeStamp" = Table.TransformColumnTypes(#"Renamed Column1 to TimeStamp",{{"TimeStamp", type datetimezone}}),
					    #"Inserted Col Date" = Table.AddColumn(#"Changed Type TimeStamp", "Date", each DateTime.Date([TimeStamp]), type date),
					    #"Inserted Col Time" = Table.AddColumn(#"Inserted Col Date", "Time", each DateTime.Time([TimeStamp]), type time),
					    #"Renamed Col Date and Time" = Table.RenameColumns(#"Inserted Col Time",{{"Date", "Date Last Refresh"}, {"Time", "Time Last Refresh"}})
					in
					    #"Renamed Col Date and Time"
			
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 06:33:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Last-Refresh-Semantic-Model-Power-Query/m-p/4795225#M11</guid>
      <dc:creator>davidkofodhanna</dc:creator>
      <dc:date>2025-08-13T06:33:09Z</dc:date>
    </item>
    <item>
      <title>Model Documentation INFO.VIEW Functions</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Model-Documentation-INFO-VIEW-Functions/m-p/4795219#M10</link>
      <description>&lt;P&gt;If you want &lt;STRONG&gt;happy live-connecting Power BI report developers&lt;/STRONG&gt; regarding providing them with global semantic model measure expressions, etc. You can include this &lt;STRONG&gt;auto-updated table&lt;/STRONG&gt; to be part of your semantic model for technical info on how you calculated the measures, calculated columns, descriptions on tables or relationships.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check it out&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Model Documentation'
		column Type
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Type]

			annotation SummarizationSetBy = Automatic

		column Name
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Name]

			annotation SummarizationSetBy = Automatic

		column Description
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Description]

			annotation SummarizationSetBy = Automatic

		column Location
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Location]

			annotation SummarizationSetBy = Automatic

		column Expression
			displayFolder: Attributes
			summarizeBy: none
			isNameInferred
			sourceColumn: [Expression]

			annotation SummarizationSetBy = Automatic

		partition 'Model Documentation' = calculated
			mode: import
			source =
					
					VAR _columns =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.COLUMNS( ),
					            [Table] &amp;lt;&amp;gt; "Model Documentation" &amp;amp;&amp;amp; NOT ( [IsHidden] )
					        ),
					        "Type", "Column",
					        "Name", [Name],
					        "Description", [Description],
					        "Location", [Table],
					        "Expression", [Expression]
					    )
					VAR _measures =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.MEASURES( ),
					            [Table] &amp;lt;&amp;gt; "Model Documentation" &amp;amp;&amp;amp; NOT ( [IsHidden] )
					        ),
					        "Type", "Measure",
					        "Name", [Name],
					        "Description", [Description],
					        "Location", [Table],
					        "Expression", [Expression]
					    )
					VAR _tables =
					    SELECTCOLUMNS(
					        FILTER(
					            INFO.VIEW.TABLES( ),
					            [Name] &amp;lt;&amp;gt; "Model Documentation" &amp;amp;&amp;amp; [Name] &amp;lt;&amp;gt; "Calculations"
					                &amp;amp;&amp;amp; NOT ( [IsHidden] )
					        ),
					        "Type", "Table",
					        "Name", [Name],
					        "Description", [Description],
					        "Location", BLANK( ),
					        "Expression", [Expression]
					    )
					VAR _relationships =
					    SELECTCOLUMNS(
					        INFO.VIEW.RELATIONSHIPS( ),
					        "Type", "Relationship",
					        "Name", [Relationship],
					        "Description", BLANK( ),
					        "Location", BLANK( ),
					        "Expression", [Relationship]
					    )
					RETURN
					    UNION( _columns, _measures, _tables, _relationships )
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 06:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Model-Documentation-INFO-VIEW-Functions/m-p/4795219#M10</guid>
      <dc:creator>davidkofodhanna</dc:creator>
      <dc:date>2025-08-13T06:29:23Z</dc:date>
    </item>
    <item>
      <title>Date table - automate sort-by-another-column and column formatting</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Date-table-automate-sort-by-another-column-and-column-formatting/m-p/4774072#M9</link>
      <description>&lt;P&gt;With date tables, we often have columns for things like month name (Jan/Feb/March/etc), day of week (Sunday, Monday, etc). We want these sorted in chronological order, not the alphabetical default. We also tend to want date-type fields to be formatted with a short date instead of a long date like "Saturday, March 1, 2025". We can do both of these at once by having an LLM modify the TMDL script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Drag your not-yet-formatted-or-sorted date table TMDL into the TMDL window to get the current column configurations, then feed it to the LLM with a prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example prompt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my date table TMDL from Power BI.&lt;/P&gt;
&lt;P&gt;{paste TMDL for date table here}&lt;BR /&gt;&lt;BR /&gt;TASKS:&lt;BR /&gt;TASK 1&lt;/P&gt;
&lt;P&gt;Add a line to each TEXT type column for sortByColumn, giving it a reference to the equivalent numeric or date type column in the code. Do not omit or change the Power Query text in your response.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TASK 2&lt;/P&gt;
&lt;P&gt;Date fields should be formatted in short date format. Add this format string text to the date-type column TMDL. Only add this to date-type fields, not text or numeric.&amp;nbsp;&lt;BR /&gt;formatString: m/d/yyyy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2025 17:36:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Date-table-automate-sort-by-another-column-and-column-formatting/m-p/4774072#M9</guid>
      <dc:creator>christinepayton</dc:creator>
      <dc:date>2025-07-23T17:36:43Z</dc:date>
    </item>
    <item>
      <title>3 "Measure Tables" With Icons</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/3-quot-Measure-Tables-quot-With-Icons/m-p/4774031#M8</link>
      <description>&lt;DIV&gt;createOrReplace&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;table '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 1.&lt;span class="lia-unicode-emoji" title=":chart_increasing:"&gt;📈&lt;/span&gt;KPIs'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 5b77fb14-15e7-485f-b4f2-04d64e555d3f&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;column Value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isHidden&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 7e2e1395-3081-47f7-8aad-43ead4d97bc6&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isNameInferred&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sourceColumn: [Value]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partition '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 1.&lt;span class="lia-unicode-emoji" title=":chart_increasing:"&gt;📈&lt;/span&gt;KPIs' = calculated&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;mode: import&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source = {0}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;table '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 2. #⃣ Variables'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 136bb655-ea44-4e2c-8e2c-4b1a937d631a&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;column Value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isHidden&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 5394559c-99f0-484f-8e48-e5940b23d215&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isNameInferred&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sourceColumn: [Value]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partition '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 2. #⃣ Variables' = calculated&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;mode: import&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source = {0}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;table '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 3.&lt;span class="lia-unicode-emoji" title=":clipboard:"&gt;📋&lt;/span&gt;Titles and Labels'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 5d7d76d1-ef56-4229-abe9-7f370a65585b&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;column Value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isHidden&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lineageTag: 453c18cd-ffa2-49be-b59b-d60ace1d4ab4&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;isNameInferred&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sourceColumn: [Value]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partition '&lt;span class="lia-unicode-emoji" title=":direct_hit:"&gt;🎯&lt;/span&gt;Measures | 3.&lt;span class="lia-unicode-emoji" title=":clipboard:"&gt;📋&lt;/span&gt;Titles and Labels' = calculated&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;mode: import&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source = {0}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Jul 2025 16:50:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/3-quot-Measure-Tables-quot-With-Icons/m-p/4774031#M8</guid>
      <dc:creator>KornAlexander</dc:creator>
      <dc:date>2025-07-23T16:50:11Z</dc:date>
    </item>
    <item>
      <title>Calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calendar-table/m-p/4770883#M6</link>
      <description>&lt;P&gt;PowerQuery implementation of a calendar table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	/// Calendar table
	table Calendar
		
		column Day
			dataType: int64
			formatString: 0
			summarizeBy: none
			sourceColumn: Day

		column Month
			dataType: int64
			formatString: 0
			summarizeBy: none
			sourceColumn: Month

		column Quarter
			dataType: string
			summarizeBy: none
			sourceColumn: Quarter

		column Year
			dataType: int64
			formatString: 0			
			summarizeBy: none
			sourceColumn: Year

		column Date
			dataType: dateTime
			formatString: Long Date
			summarizeBy: none
			sourceColumn: Date

			annotation UnderlyingDateTimeDataType = Date

		column 'Month Name'
			dataType: string
			summarizeBy: none
			sourceColumn: Month Name
			sortByColumn: Month

		column Year-Month
			dataType: dateTime
			formatString: mmm yyyy
			summarizeBy: none
			sourceColumn: Year-Month		

			annotation UnderlyingDateTimeDataType = Date

			annotation PBI_FormatHint = {"isCustom":true}

		column 'Week Number'
			dataType: int64
			formatString: 0		
			summarizeBy: none
			sourceColumn: Week Number			

		column 'Day of Week'
			dataType: int64
			formatString: 0			
			summarizeBy: none
			sourceColumn: Day of Week			

		column 'Day Name'
			dataType: string			
			summarizeBy: none
			sourceColumn: Day Name
			sortByColumn: 'Day of Week'						

		column 'Is Weekend'
			dataType: boolean
			formatString: """TRUE"";""TRUE"";""FALSE"""			
			summarizeBy: none
			sourceColumn: Is Weekend			

		column 'Fiscal Year'
			dataType: int64
			formatString: 0			
			summarizeBy: none
			sourceColumn: Fiscal Year			

		column 'Fiscal Quarter'
			dataType: string			
			summarizeBy: none
			sourceColumn: Fiscal Quarter			

		hierarchy Year-Month-Day			

			level Year				
				column: Year

			level Month				
				column: Month

			level Day				
				column: Day

		partition Calendar = m
			mode: import
			source = ```
					let 
					
					    P_Today =  DateTime.LocalNow(),
					    StartDate = #date(Date.Year(DateTime.LocalNow()) - 3, 1, 1),
					    EndDate  = #date(Date.Year(DateTime.LocalNow()), 12, 31),  
					
					    // Generate a list of dates
					    DateList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1, 0, 0, 0)),
					
					    // Convert list to a table
					    Calendar = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),
					
					    // Add columns for different date attributes
					    AddYear = Table.AddColumn(Calendar, "Year", each Date.Year([Date])),
					    AddMonth = Table.AddColumn(AddYear, "Month", each Date.Month([Date])),
					    AddDay = Table.AddColumn(AddMonth, "Day", each Date.Day([Date])),
					    AddMonthName = Table.AddColumn(AddDay, "Month Name", each Date.ToText([Date], "MMM")),
					    AddYearMonth = Table.AddColumn(AddMonthName, "Year-Month", each Text.From(Date.Year([Date])) &amp;amp; " " &amp;amp; Date.ToText([Date], "MMM")),
					    //AddYearMonthKey = Table.AddColumn(AddYearMonth, "Year-Month Key", each Date.Year([Date]) * 100 + Date.Month([Date])),
					    AddQuarter = Table.AddColumn(AddYearMonth, "Quarter", each "Q" &amp;amp; Text.From(Date.QuarterOfYear([Date]))),
					    AddWeek = Table.AddColumn(AddQuarter, "Week Number", each Date.WeekOfYear([Date])),
					    AddDayOfWeek = Table.AddColumn(AddWeek, "Day of Week", each Date.DayOfWeek([Date]) + 1),
					    AddDayName = Table.AddColumn(AddDayOfWeek, "Day Name", each Date.ToText([Date], "dddd")),
					    AddIsWeekend = Table.AddColumn(AddDayName, "Is Weekend", each if Date.DayOfWeek([Date]) &amp;gt;= 5 then true else false),
					
					    // Add fiscal year and period adjustments
					    AddFiscalYear = Table.AddColumn(AddIsWeekend, "Fiscal Year", each if Date.Month([Date]) &amp;gt;= 7 then Date.Year([Date]) + 1 else Date.Year([Date])),
					    AddFiscalQuarter = Table.AddColumn(AddFiscalYear, "Fiscal Quarter", each "FQ" &amp;amp; Text.From(Number.IntegerDivide((Date.Month([Date]) + 5), 3))),
					    #"Changed Type" = Table.TransformColumnTypes(AddFiscalQuarter,{{"Date", type date}, {"Year", Int64.Type}, {"Month", Int64.Type}, {"Day", Int64.Type}, {"Month Name", type text}, {"Year-Month", type date}, {"Quarter", type text}, {"Week Number", Int64.Type}, {"Day of Week", Int64.Type}, {"Day Name", type text}, {"Is Weekend", type logical}, {"Fiscal Year", Int64.Type}, {"Fiscal Quarter", type text}})
					
					in
					    #"Changed Type"
					```	&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Jul 2025 13:52:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Calendar-table/m-p/4770883#M6</guid>
      <dc:creator>RuiRomanoMS</dc:creator>
      <dc:date>2025-07-21T13:52:52Z</dc:date>
    </item>
    <item>
      <title>Time intelligence calculation group</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Time-intelligence-calculation-group/m-p/4770878#M5</link>
      <description>&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Time Intelligence'

		calculationGroup
			precedence: 1

			calculationItem YTD =
					CALCULATE (
					    SELECTEDMEASURE (),
					    DATESYTD ( 'Calendar'[Date] )
					)

			calculationItem QTD =
					
					CALCULATE (
					    SELECTEDMEASURE (),
					    DATESQTD ( 'Calendar'[Date] )
					)

			calculationItem MTD =
					CALCULATE (
					    SELECTEDMEASURE (),
					    DATESMTD ( 'Calendar'[Date] )
					)

			calculationItem PY =
					
					CALCULATE (
					    SELECTEDMEASURE (),
					    SAMEPERIODLASTYEAR ( 'Calendar'[Date] )
					)

			calculationItem YOY% =
					
					DIVIDE (
					    CALCULATE (
					        SELECTEDMEASURE (),
					        'Time Intelligence'[Show as] = "YOY"
					    ),
					    CALCULATE (
					        SELECTEDMEASURE (),
					        'Time Intelligence'[Show as] = "PY"
					    )
					)

				formatStringDefinition = "#,##0.00%"

			calculationItem YOY =
					
					SELECTEDMEASURE ()
					    - CALCULATE (
					        SELECTEDMEASURE (),
					        'Time intelligence'[Show as] = "PY"
					    )

			calculationItem Current = SELECTEDMEASURE()

		column 'Show as'
			dataType: string
			summarizeBy: none
			sourceColumn: Name
			sortByColumn: Ordinal

		column Ordinal
			dataType: int64
			formatString: 0
			summarizeBy: sum
			sourceColumn: Ordinal&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Jul 2025 13:51:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Time-intelligence-calculation-group/m-p/4770878#M5</guid>
      <dc:creator>RuiRomanoMS</dc:creator>
      <dc:date>2025-07-21T13:51:29Z</dc:date>
    </item>
    <item>
      <title>Smart calcs calculation group</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Smart-calcs-calculation-group/m-p/4770873#M4</link>
      <description>&lt;P&gt;A calculation group with generic calculation items that work with any model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	table 'Smart Calcs'	

		calculationGroup

			calculationItem Normalize = ```
					VAR DetailValue = SELECTEDMEASURE()
					
					return if (DetailValue, 
					
					    VAR MinOfGroup = MINX(ALLSELECTED('Calendar'), SELECTEDMEASURE())
					    VAR MaxOfGroup = MAXX(ALLSELECTED('Calendar'), SELECTEDMEASURE())
					
					    RETURN DIVIDE(DetailValue - MinOfGroup, MaxOfGroup - MinOfGroup)
					)
					```

				formatStringDefinition = "0.0"

			calculationItem Randomize = IFERROR(SELECTEDMEASURE() * RAND(), SELECTEDMEASURE())

			calculationItem 'Label - ▲ LY' = ```
					var vValue = SELECTEDMEASURE()
					var vValueLY = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Calendar'[Date]))
					var vGrowth = DIVIDE(vValue - vValueLY, vValueLY)
					var vFormat = SELECTEDMEASUREFORMATSTRING()
					
					return
					    FORMAT(vValue, vFormat)
					    &amp;amp; IF (ISBLANK(vGrowth)
					        , BLANK()
					        , " | "    
					        &amp;amp; IF (vGrowth &amp;gt;= 0, "▲" , "▼") &amp;amp; FORMAT(vGrowth, "0%")
					    )
					
					```

				formatStringDefinition = SELECTEDMEASUREFORMATSTRING()

			calculationItem 'Label - ▲ LM' = ```
					var vValue = SELECTEDMEASURE()
					var vValueLM = CALCULATE(SELECTEDMEASURE(), PREVIOUSMONTH('Calendar'[Date]))
					var vGrowth = DIVIDE(vValue - vValueLM, vValueLM)
					var vFormat = SELECTEDMEASUREFORMATSTRING()
					
					return
					    FORMAT(vValue, vFormat)
					    &amp;amp; IF (ISBLANK(vGrowth)
					        , BLANK()
					        , " | "    
					        &amp;amp; IF (vGrowth &amp;gt;= 0, "▲" , "▼") &amp;amp; FORMAT(vGrowth, "0%")
					    )
					
					```

				formatStringDefinition = SELECTEDMEASUREFORMATSTRING()

		column 'Smart Calc'
			dataType: string			
			summarizeBy: none
			sourceColumn: Name
			sortByColumn: Ordinal			

		column Ordinal
			dataType: int64
			isHidden			
			summarizeBy: none
			sourceColumn: Ordinal			&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 13:49:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Smart-calcs-calculation-group/m-p/4770873#M4</guid>
      <dc:creator>RuiRomanoMS</dc:creator>
      <dc:date>2025-07-21T13:49:58Z</dc:date>
    </item>
    <item>
      <title>About table</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/About-table/m-p/4767327#M3</link>
      <description>&lt;P&gt;A table that include information about the semantic model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;createOrReplace

	/// Table with information about the model.
	/// Key/Value representation, with properties like: last refresh; model creator;...
	table About		

		column Key
			dataType: string			
			summarizeBy: none
			sourceColumn: Key		

		column Value
			dataType: string			
			summarizeBy: none
			sourceColumn: Value			

		column Order
			dataType: int64
			formatString: 0			
			summarizeBy: none
			sourceColumn: Order			

		partition About-77c21240-7751-4575-bf40-8c068bfd01cd = m
			mode: import
			source =
					let
						Source = #table({ "Key", "Value" },{
							{ "Developed by", "Microsoft" },
							{ "Version", "1.0" },
							{ "Description", "Sales.pbip" },
							{ "Last Refresh", DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-dd HH:mm:ss") }
						}),
						#"Added Index" = Table.AddIndexColumn(Source, "Order", 1, 1),
						#"Changed Type" = Table.TransformColumnTypes(#"Added Index",{{"Key", type text},  {"Value", type text},{"Order", Int64.Type}}),
						#"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"Key", "Value", "Order"})
					in
						#"Reordered Columns"

		annotation PBI_ResultType = Table&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 16:41:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/About-table/m-p/4767327#M3</guid>
      <dc:creator>RuiRomanoMS</dc:creator>
      <dc:date>2025-07-17T16:41:28Z</dc:date>
    </item>
    <item>
      <title>Measures table</title>
      <link>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Measures-table/m-p/4767324#M2</link>
      <description>&lt;LI-CODE lang="markup"&gt;createOrReplace

	table _Measures		

		measure 'Sample Measure' = NOW()
			formatString: General Date			

		column Value
			isHidden						
			summarizeBy: sum
			isNameInferred
			sourceColumn: [Value]

		partition _Measures = calculated
			mode: import
			source = {BLANK()}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 16:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/TMDL-Gallery/Measures-table/m-p/4767324#M2</guid>
      <dc:creator>RuiRomanoMS</dc:creator>
      <dc:date>2025-07-17T16:39:31Z</dc:date>
    </item>
  </channel>
</rss>

