diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Finance app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Finance app.pbix index 9c77af828f..bacadef371 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Finance app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Finance app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Inventory Valuation app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Inventory Valuation app.pbix index 97a479c020..9f7828b208 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Inventory Valuation app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Inventory Valuation app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Inventory app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Inventory app.pbix index 77fbcb1eb2..750b227869 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Inventory app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Inventory app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Manufacturing app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Manufacturing app.pbix index 2e000d54d4..94e85aa508 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Manufacturing app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Manufacturing app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Projects app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Projects app.pbix index 17253481eb..b0955be38f 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Projects app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Projects app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Purchase app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Purchase app.pbix index ce4ea5426d..d4ebfbaae6 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Purchase app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Purchase app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/App/.resources/Sales app.pbix b/src/Apps/W1/PowerBIReports/App/.resources/Sales app.pbix index 481c79c7a2..e3023d0fd0 100644 Binary files a/src/Apps/W1/PowerBIReports/App/.resources/Sales app.pbix and b/src/Apps/W1/PowerBIReports/App/.resources/Sales app.pbix differ diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Customer Ledger Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Customer Ledger Entries.tmdl index 29e9bb0991..9630c6d95e 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Customer Ledger Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Customer Ledger Entries.tmdl @@ -237,17 +237,31 @@ table 'Customer Ledger Entries' VAR USEDOCUMENTDATE = CALCULATE( CONCATENATEX(VALUES('Customer Ledger Entries'[Document No.]), 'Customer Ledger Entries'[Document No.], "|"), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ASATDATE)) + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[CLE Due Date],STARTDATE,ASATDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Posting Date (Calculated)],STARTDATE,ASATDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ASATDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" + ) & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links lineageTag: e12e614f-24d7-4361-9aab-d726e93ca806 @@ -277,17 +291,29 @@ table 'Customer Ledger Entries' CONCATENATEX(VALUES('Customer Ledger Entries'[Document No.]), 'Customer Ledger Entries'[Document No.], "|"), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) - VAR RESULT = [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[CLE Due Date],STARTDATE,ENDDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Posting Date (Calculated)],STARTDATE,ENDDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links lineageTag: 4ccffb1b-2e9c-4908-a8ac-c51a8f43c1eb @@ -316,17 +342,29 @@ table 'Customer Ledger Entries' CONCATENATEX(VALUES('Customer Ledger Entries'[Document No.]), 'Customer Ledger Entries'[Document No.], "|"), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) - VAR RESULT = [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[CLE Due Date],STARTDATE,ENDDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Posting Date (Calculated)],STARTDATE,ENDDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Customer Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links lineageTag: 7df05800-f60d-4e79-8d8a-c0c631a8a6bc @@ -353,17 +391,29 @@ table 'Customer Ledger Entries' CONCATENATEX(VALUES('Customer Ledger Entries'[Document No.]), 'Customer Ledger Entries'[Document No.], "|"), 'Customer Ledger Entries'[Document Date (Calculated)] < ENDDATE) - VAR RESULT = [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[CLE Due Date] < ENDDATE) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[Posting Date (Calculated)] < ENDDATE) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[Document Date (Calculated)] < ENDDATE) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links lineageTag: dc890c9e-fd68-484e-9680-218a516a053b @@ -386,17 +436,29 @@ table 'Customer Ledger Entries' CONCATENATEX(VALUES('Customer Ledger Entries'[Document No.]), 'Customer Ledger Entries'[Document No.], "|"), 'Customer Ledger Entries'[Document Date (Calculated)] >= STARTDATE ) - VAR RESULT = [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[CLE Due Date] >= STARTDATE) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[Posting Date (Calculated)] >= STARTDATE) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Customer Ledger Entries'[Document No.]), LEN('Customer Ledger Entries'[Document No.]) + 1), 'Customer Ledger Entries'[Document Date (Calculated)] >= STARTDATE) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Customer Ledger Entries'[Document Type]), 'Customer Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links lineageTag: 5833c2e9-c725-4221-86e5-d53ff08d9e13 @@ -417,16 +479,30 @@ table 'Customer Ledger Entries' 'Date'[Date] <= MAX ( 'Date'[Date] ) ) ) - VAR RESULT = + VAR DocumentsLength = + CALCULATE ( + SUMX ( VALUES ( 'Customer Ledger Entries'[Document No.] ), LEN ( 'Customer Ledger Entries'[Document No.] ) + 1 ), + FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ) + ) + // Project the URL length without building the (possibly huge) Document No. list + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), LEN ( 'Customer Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + DocumentsLength + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=25&filter='Cust. Ledger Entry'.'Document Type' IS '" & CONCATENATEX ( VALUES ( 'Customer Ledger Entries'[Document Type] ), 'Customer Ledger Entries'[Document Type], "|" - ) & "' - AND 'Document No.' IS '" & DocumentsInContext & "'" - RETURN - RESULT + ) & "' AND 'Document No.' IS '" & DocumentsInContext & "'", + [Base Link] & "&page=25" + ) ``` displayFolder: _Customer Ledger Measures\_Customer Ledger Back Links diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Budget Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Budget Entries.tmdl index 3967436da3..7f58af2f05 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Budget Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Budget Entries.tmdl @@ -25,23 +25,41 @@ table 'G/L Budget Entries' VAR Endpoint = "&page=120&" VAR baseLink = [Base Link] & Endpoint - // Build filter context - var budgetName = CONCATENATEX(VALUES('G/L Budget Entries'[Budget Name]), [Budget Name], "|") - VAR GLAccounts = - VALUES ( 'G/L Account'[G/L Account No.] ) + // Build filter context(scalar/range values only ) VAR MinGLAcc = MIN ( 'G/L Account'[G/L Account No.] ) VAR MaxGLAcc = MAX ( 'G/L Account'[G/L Account No.] ) - VAR DimensionSets = CONCATENATEX(VALUES('G/L Budget Entries'[dimensionSetID]), [dimensionSetID], "|") - - // Build URL string components VAR GLAccountRange = MinGLAcc & ".." & MaxGLAcc - VAR GLAccountFilter = "filter='G/L Budget Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" - VAR GLPostingDateFilter = " AND 'G/L Budget Entry'.'Date' IS " & "'" & [Ranged] & "'" - VAR GLBudgetFilter = " AND 'G/L Budget Entry'.'Budget Name' IS " & "'" & budgetName & "'" - VAR DimensionSetFilter = " AND 'G/L Budget Entry'.'Dimension Set ID' IS " & "'" & DimensionSets & "'" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='G/L Budget Entry'.'G/L Account No.' IS ''" ) + LEN ( GLAccountRange ) + + LEN ( " AND 'G/L Budget Entry'.'Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'G/L Budget Entry'.'Budget Name' IS ''" ) + + SUMX ( VALUES ( 'G/L Budget Entries'[Budget Name] ), LEN ( 'G/L Budget Entries'[Budget Name] ) + 1 ) + + LEN ( " AND 'G/L Budget Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'G/L Budget Entries'[dimensionSetID] ), LEN ( 'G/L Budget Entries'[dimensionSetID] ) + 1 ) RETURN - baseLink & GLAccountFilter & GLPostingDateFilter & GLBudgetFilter & DimensionSetFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='G/L Budget Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" + & " AND 'G/L Budget Entry'.'Date' IS " & "'" & [Ranged] & "'" + & " AND 'G/L Budget Entry'.'Budget Name' IS " & "'" & CONCATENATEX(VALUES('G/L Budget Entries'[Budget Name]), [Budget Name], "|") & "'" + & " AND 'G/L Budget Entry'.'Dimension Set ID' IS " & "'" & CONCATENATEX(VALUES('G/L Budget Entries'[dimensionSetID]), [dimensionSetID], "|") & "'", + baseLink + ) displayFolder: _G/L Budget Entry Measures\_G/L Budget Entry Back Links lineageTag: 1dcb8fc2-2a72-419b-ac3e-527433816439 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl index d89c8750fd..54bb693017 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl @@ -80,27 +80,44 @@ table 'G/L Entries' VAR Endpoint = "&page=20&" VAR baseLink = [Base Link] & Endpoint - // Build filter context + // Build filter context (scalar/range values only) VAR ClosingEntries = VALUES ( 'Closing Entry Filter Table'[CloseIncomeSourceCodeFilter] ) - VAR GLAccounts = - VALUES ( 'G/L Account'[G/L Account No.] ) VAR MinGLAcc = MIN ( 'G/L Account'[G/L Account No.] ) VAR MaxGLAcc = MAX ( 'G/L Account'[G/L Account No.] ) - VAR DimensionSets = - CONCATENATEX ( VALUES ( 'G/L Entries'[dimensionSetID] ), [dimensionSetID], "|" ) - - // Build URL string components VAR GLAccountRange = MinGLAcc & ".." & MaxGLAcc - VAR GLAccountFilter = "filter='G/L Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" - VAR GLPostingDateFilter = " AND 'G/L Entry'.'Posting Date' IS " & "'" & [Ranged] & "'" - VAR SourceCodeFilter = " AND 'G/L Entry'.'Source Code' IS " & "'" & ClosingEntries & "'" - VAR DimensionSetFilter = " AND 'G/L Entry'.'Dimension Set ID' IS " & "'" & DimensionSets & "'" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='G/L Entry'.'G/L Account No.' IS ''" ) + LEN ( GLAccountRange ) + + LEN ( " AND 'G/L Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'G/L Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'G/L Entries'[dimensionSetID] ), LEN ( 'G/L Entries'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'G/L Entry'.'Source Code' IS ''" ) + LEN ( ClosingEntries ) RETURN - baseLink & GLAccountFilter & GLPostingDateFilter & DimensionSetFilter & SourceCodeFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='G/L Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" + & " AND 'G/L Entry'.'Posting Date' IS " & "'" & [Ranged] & "'" + & " AND 'G/L Entry'.'Dimension Set ID' IS " & "'" & + CONCATENATEX ( VALUES ( 'G/L Entries'[dimensionSetID] ), [dimensionSetID], "|" ) & "'" & " AND 'G/L Entry'.'Source Code' IS " & "'" & ClosingEntries & "'", + baseLink + ) ``` displayFolder: _G/L Entry Measures\_G/L Entry Back Links @@ -114,18 +131,38 @@ table 'G/L Entries' VAR Endpoint = "&page=20&" VAR baseLink = [Base Link] & Endpoint - // Build filter context + // Build filter context (scalar/range values only) VAR maxdate = MAX ( 'Date'[Date] ) - VAR GLAccounts = - VALUES ( 'G/L Account'[G/L Account No.] ) VAR dateRange = ".." & FORMAT ( maxdate, "yyyy-mm-dd" ) VAR MinGLAcc = MIN ( 'G/L Account'[G/L Account No.] ) VAR MaxGLAcc = MAX ( 'G/L Account'[G/L Account No.] ) - VAR DimensionSets = + VAR GLAccountRange = MinGLAcc & ".." & MaxGLAcc + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='G/L Entry'.'G/L Account No.' IS ''" ) + LEN ( GLAccountRange ) + + LEN ( " AND 'G/L Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( + CALCULATETABLE ( + VALUES ( 'G/L Entries'[dimensionSetID] ), + ALL ( 'Date'[Date] ), + 'Date'[Date] <= MAX ( 'Date'[Date] ) + ), + LEN ( 'G/L Entries'[dimensionSetID] ) + 1 + ) + + LEN ( " AND 'G/L Entry'.'Posting Date' IS ''" ) + LEN ( dateRange ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='G/L Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" + & " AND 'G/L Entry'.'Dimension Set ID' IS " & "'" & CONCATENATEX ( CALCULATETABLE ( VALUES ( 'G/L Entries'[dimensionSetID] ), @@ -133,15 +170,9 @@ table 'G/L Entries' 'Date'[Date] <= MAX ( 'Date'[Date] ) ), [dimensionSetID], "|" + ) & "'" & " AND 'G/L Entry'.'Posting Date' IS " & "'" & dateRange & "'", + baseLink ) - - // Build URL string components - VAR GLAccountRange = MinGLAcc & ".." & MaxGLAcc - VAR GLAccountFilter = "filter='G/L Entry'.'G/L Account No.' IS " & "'" & GLAccountRange & "'" - VAR GLPostingDateFilter = " AND 'G/L Entry'.'Posting Date' IS " & "'" & dateRange & "'" - VAR DimensionSetFilter = " AND 'G/L Entry'.'Dimension Set ID' IS " & "'" & DimensionSets & "'" - RETURN - baseLink & GLAccountFilter & DimensionSetFilter & GLPostingDateFilter ``` diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Vendor Ledger Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Vendor Ledger Entries.tmdl index c23ab82e82..701b93f649 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Vendor Ledger Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Vendor Ledger Entries.tmdl @@ -232,17 +232,29 @@ table 'Vendor Ledger Entries' CONCATENATEX(VALUES('Vendor Ledger Entries'[Document No.]), 'Vendor Ledger Entries'[Document No.], "|"), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ASATDATE)) - VAR RESULT = [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[VLE Due Date],STARTDATE,ASATDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Posting Date (Calculated)],STARTDATE,ASATDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ASATDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=29" + ) ``` formatString: #,0.00 displayFolder: _Vendor Ledger Measures\_VLE Back Links @@ -272,17 +284,29 @@ table 'Vendor Ledger Entries' CONCATENATEX(VALUES('Vendor Ledger Entries'[Document No.]), 'Vendor Ledger Entries'[Document No.], "|"), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) - VAR RESULT = [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[VLE Due Date],STARTDATE,ENDDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Posting Date (Calculated)],STARTDATE,ENDDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=29" + ) ``` formatString: #,0.00 displayFolder: _Vendor Ledger Measures\_VLE Back Links @@ -314,17 +338,29 @@ table 'Vendor Ledger Entries' CONCATENATEX(VALUES('Vendor Ledger Entries'[Document No.]), 'Vendor Ledger Entries'[Document No.], "|"), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) - VAR RESULT = [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[VLE Due Date],STARTDATE,ENDDATE)) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Posting Date (Calculated)],STARTDATE,ENDDATE)) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), DATESBETWEEN('Vendor Ledger Entries'[Document Date (Calculated)],STARTDATE,ENDDATE)) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=29" + ) ``` formatString: #,0.00 displayFolder: _Vendor Ledger Measures\_VLE Back Links @@ -354,17 +390,29 @@ table 'Vendor Ledger Entries' CONCATENATEX(VALUES('Vendor Ledger Entries'[Document No.]), 'Vendor Ledger Entries'[Document No.], "|"), 'Vendor Ledger Entries'[Document Date (Calculated)] < ENDDATE) - VAR RESULT = [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[VLE Due Date] < ENDDATE) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[Posting Date (Calculated)] < ENDDATE) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[Document Date (Calculated)] < ENDDATE) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=29" + ) ``` formatString: #,0.00 displayFolder: _Vendor Ledger Measures\_VLE Back Links @@ -390,17 +438,29 @@ table 'Vendor Ledger Entries' CONCATENATEX(VALUES('Vendor Ledger Entries'[Document No.]), 'Vendor Ledger Entries'[Document No.], "|"), 'Vendor Ledger Entries'[Document Date (Calculated)] >= STARTDATE ) - VAR RESULT = [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" - & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' - AND 'Document No.' IS '" - & SWITCH( - VALUES('Aging Date Parameter'[AGING PARAMETER]), + VAR USEDUEDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[VLE Due Date] >= STARTDATE) + VAR USEPOSTINGDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[Posting Date (Calculated)] >= STARTDATE) + VAR USEDOCUMENTDATELEN = CALCULATE(SUMX(VALUES('Vendor Ledger Entries'[Document No.]), LEN('Vendor Ledger Entries'[Document No.]) + 1), 'Vendor Ledger Entries'[Document Date (Calculated)] >= STARTDATE) + VAR AgingParam = VALUES('Aging Date Parameter'[AGING PARAMETER]) + // Project the URL length; only the selected Document No. list is measured, then built if it fits + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + SWITCH ( AgingParam, "Due Date", USEDUEDATELEN, "Posting Date", USEPOSTINGDATELEN, "Document Date", USEDOCUMENTDATELEN ) + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" + & CONCATENATEX(VALUES('Vendor Ledger Entries'[Document Type]), 'Vendor Ledger Entries'[Document Type], "|") & "' AND 'Document No.' IS '" + & SWITCH( AgingParam, "Due Date", USEDUEDATE, "Posting Date",USEPOSTINGDATE, "Document Date",USEDOCUMENTDATE - ) & "'" - - RETURN RESULT + ) & "'", + [Base Link] & "&page=29" + ) ``` displayFolder: _Vendor Ledger Measures\_VLE Back Links lineageTag: ed2109be-d4cb-45ae-a9ce-1c6e5ba61283 @@ -423,16 +483,30 @@ table 'Vendor Ledger Entries' 'Date'[Date] <= MAX ( 'Date'[Date] ) ) ) - VAR RESULT = + VAR DocumentsLength = + CALCULATE ( + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document No.] ), LEN ( 'Vendor Ledger Entries'[Document No.] ) + 1 ), + FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ) + ) + // Project the URL length without building the (possibly huge) Document No. list + VAR ProjectedLength = + LEN ( [Base Link] ) + LEN ( "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" ) + + SUMX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), LEN ( 'Vendor Ledger Entries'[Document Type] ) + 1 ) + + LEN ( "' AND 'Document No.' IS '" ) + + DocumentsLength + + LEN ( "'" ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, [Base Link] & "&page=29&filter='Vendor Ledger Entry'.'Document Type' IS '" & CONCATENATEX ( VALUES ( 'Vendor Ledger Entries'[Document Type] ), 'Vendor Ledger Entries'[Document Type], "|" - ) & "' - AND 'Document No.' IS '" & DocumentsInContext & "'" - RETURN - RESULT + ) & "' AND 'Document No.' IS '" & DocumentsInContext & "'", + [Base Link] & "&page=29" + ) ``` displayFolder: _Vendor Ledger Measures\_VLE Back Links diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl index 69888d97c1..a938aa635a 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl @@ -442,12 +442,41 @@ table 'Value Entries' measure 'Value Entry Back Link' = ``` - VAR PostingDateFilter = " AND 'Value Entry'.'Posting Date' IS '" & [Date Ranged] & "'" + VAR PageLink = [Base Link] & "&page=5802" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR SelectedEntryNos = VALUES ( 'Value Entries'[Entry No.] ) + VAR MaxEntryNoDigits = LEN ( MAXX ( SelectedEntryNos, 'Value Entries'[Entry No.] ) & "" ) + VAR EntryNoRangeStarts = + FILTER ( + SelectedEntryNos, + VAR CurrentEntryNo = 'Value Entries'[Entry No.] + RETURN COUNTROWS ( FILTER ( SelectedEntryNos, 'Value Entries'[Entry No.] = CurrentEntryNo - 1 ) ) = 0 + ) + // Conservative estimate: bound each run by (2 * widest selected entry no + separator/range marker) + VAR ProjectedEntryNoRangedLength = COUNTROWS ( EntryNoRangeStarts ) * ( 2 * MaxEntryNoDigits + 3 ) + // Project the URL length from run counts and digit widths without materializing the ranged strings + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Value Entry'.'Entry No.' IS ''" ) + ProjectedEntryNoRangedLength + + LEN ( " AND 'Value Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN IF ( NOT ISFILTERED ( 'Date' ), BLANK (), - [Base Link] & "&page=5802&filter='Value Entry'.'Entry No.' IS '" & [Value Entry Ranged] & "'" & PostingDateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PageLink & "&filter='Value Entry'.'Entry No.' IS '" & [Value Entry Ranged] & "'" & " AND 'Value Entry'.'Posting Date' IS '" & [Date Ranged] & "'", + PageLink + ) ) ``` diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Headers.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Headers.tmdl index 9c147cf4f2..fc843b8fac 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Headers.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Headers.tmdl @@ -20,14 +20,22 @@ table 'Assembly Headers' VAR Endpoint = "&page=902&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Assembly Headers'[itemNo]),'Assembly Headers'[itemNo], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Assembly Headers'[dimensionSetID]), 'Assembly Headers'[dimensionSetID], "|") - - VAR ItemFilter = "filter='Assembly Header'.'Item No.' IS '" & Items & "'" - VAR DimensionFilter = " AND 'Assembly Header'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Assembly Header'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Assembly Headers'[itemNo] ), LEN ( 'Assembly Headers'[itemNo] ) + 1 ) + + LEN ( " AND 'Assembly Header'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Assembly Headers'[dimensionSetID] ), LEN ( 'Assembly Headers'[dimensionSetID] ) + 1 ) RETURN - BaseLink & ItemFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Assembly Header'.'Item No.' IS '" & CONCATENATEX(VALUES('Assembly Headers'[itemNo]),'Assembly Headers'[itemNo], "|") & "'" + & " AND 'Assembly Header'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Assembly Headers'[dimensionSetID]), 'Assembly Headers'[dimensionSetID], "|") & "'", + BaseLink + ) lineageTag: 3d92849b-6824-4e15-901a-75d98078471d column itemNo diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Lines.tmdl index 7a14ebb128..af9817b16c 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Assembly Lines.tmdl @@ -18,14 +18,22 @@ table 'Assembly Lines' VAR Endpoint = "&page=903&" VAR BaseLink = [Base Link] & Endpoint VAR OrderBaseLink = BaseLink & "filter='Assembly Line'.'Document Type' IS 'Order'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Assembly Lines'[itemNo]),'Assembly Lines'[itemNo], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Assembly Lines'[dimensionSetID]), 'Assembly Lines'[dimensionSetID], "|") - - VAR ItemFilter = " AND 'Assembly Line'.'No.' IS '" & Items & "'" - VAR DimensionFilter = " AND 'Assembly Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( OrderBaseLink ) + + LEN ( " AND 'Assembly Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Assembly Lines'[itemNo] ), LEN ( 'Assembly Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Assembly Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Assembly Lines'[dimensionSetID] ), LEN ( 'Assembly Lines'[dimensionSetID] ) + 1 ) RETURN - OrderBaseLink & ItemFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + OrderBaseLink + & " AND 'Assembly Line'.'No.' IS '" & CONCATENATEX(VALUES('Assembly Lines'[itemNo]),'Assembly Lines'[itemNo], "|") & "'" + & " AND 'Assembly Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Assembly Lines'[dimensionSetID]), 'Assembly Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 19f9d473-1224-45dd-b93a-54bda8096b7f diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Bin.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Bin.tmdl index e12b01020a..f68a2d3225 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Bin.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Bin.tmdl @@ -110,51 +110,78 @@ table Bin VAR Endpoint = "&page=7318&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Warehouse Entries'[Item No.]),'Warehouse Entries'[Item No.], "|") + // Project the URL length from the raw filter values without building the(possibly huge) URL string VAR BinCode = SELECTEDVALUE('Bin'[Bin Code]) VAR LocationCode = SELECTEDVALUE(Bin[Bin Location Code]) - VAR BinCodeFilter = "filter='Warehouse Entry'.'Bin Code' IS '" & BinCode & "'" - VAR ItemFilter = " AND 'Warehouse Entry'.'Item No.' IS '" & Items & "'" - VAR LocationFilter = " AND 'Warehouse Entry'.'Location Code' IS '" & LocationCode & "'" - + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Warehouse Entry'.'Bin Code' IS ''" ) + LEN ( BinCode ) + + LEN ( " AND 'Warehouse Entry'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Warehouse Entries'[Item No.] ), LEN ( 'Warehouse Entries'[Item No.] ) + 1 ) + + LEN ( " AND 'Warehouse Entry'.'Location Code' IS ''" ) + LEN ( LocationCode ) RETURN - BaseLink & BinCodeFilter & ItemFilter & LocationFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Warehouse Entry'.'Bin Code' IS '" & BinCode & "'" + & " AND 'Warehouse Entry'.'Item No.' IS '" & CONCATENATEX ( VALUES ( 'Warehouse Entries'[Item No.] ), 'Warehouse Entries'[Item No.], "|" ) & "'" + & " AND 'Warehouse Entry'.'Location Code' IS '" & LocationCode & "'", + BaseLink + ) lineageTag: 0d8d0644-43c7-4675-bbc9-c23b96954f4c measure 'Pick Quantity Link' = VAR Endpoint = "&page=5785&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Warehouse Activity Lines'[itemNo]),'Warehouse Activity Lines'[itemNo], "|") + // Project the URL length from the raw filter values without building the(possibly huge) URL string VAR BinCode = SELECTEDVALUE('Bin'[Bin Code]) VAR LocationCode = SELECTEDVALUE(Bin[Bin Location Code]) - VAR BinCodeFilter = "filter='Warehouse Activity Line'.'Bin Code' IS '" & BinCode & "'" - VAR ItemFilter = " AND 'Warehouse Activity Line'.'Item No.' IS '" & Items & "'" - VAR LocationFilter = " AND 'Warehouse Activity Line'.'Location Code' IS '" & LocationCode & "'" - + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Warehouse Activity Line'.'Bin Code' IS ''" ) + LEN ( BinCode ) + + LEN ( " AND 'Warehouse Activity Line'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Warehouse Activity Lines'[itemNo] ), LEN ( 'Warehouse Activity Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Warehouse Activity Line'.'Location Code' IS ''" ) + LEN ( LocationCode ) RETURN - BaseLink & BinCodeFilter & ItemFilter & LocationFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Warehouse Activity Line'.'Bin Code' IS '" & BinCode & "'" + & " AND 'Warehouse Activity Line'.'Item No.' IS '" & CONCATENATEX ( VALUES ( 'Warehouse Activity Lines'[itemNo] ), 'Warehouse Activity Lines'[itemNo], "|" ) & "'" + & " AND 'Warehouse Activity Line'.'Location Code' IS '" & LocationCode & "'", + BaseLink + ) lineageTag: 37053bd0-f109-4bb0-a5ee-8d0351d2cc82 measure 'Warehouse Journal Link' = VAR Endpoint = "&page=7319&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Warehouse Journal Lines (From Bin)'[itemNo]),'Warehouse Journal Lines (From Bin)'[itemNo], "|") + // Project the URL length from the raw filter values without building the(possibly huge) URL string VAR BinCode = SELECTEDVALUE('Bin'[Bin Code]) VAR LocationCode = SELECTEDVALUE(Bin[Bin Location Code]) - VAR BinCodeFilter = "filter='Warehouse Journal Line'.'Bin Code' IS '" & BinCode & "'" - VAR ItemFilter = " AND 'Warehouse Journal Line'.'Item No.' IS '" & Items & "'" - VAR LocationFilter = " AND 'Warehouse Journal Line'.'Location Code' IS '" & LocationCode & "'" - + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Warehouse Journal Line'.'Bin Code' IS ''" ) + LEN ( BinCode ) + + LEN ( " AND 'Warehouse Journal Line'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Warehouse Journal Lines (From Bin)'[itemNo] ), LEN ( 'Warehouse Journal Lines (From Bin)'[itemNo] ) + 1 ) + + LEN ( " AND 'Warehouse Journal Line'.'Location Code' IS ''" ) + LEN ( LocationCode ) RETURN - BaseLink & BinCodeFilter & ItemFilter & LocationFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Warehouse Journal Line'.'Bin Code' IS '" & BinCode & "'" + & " AND 'Warehouse Journal Line'.'Item No.' IS '" & CONCATENATEX ( VALUES ( 'Warehouse Journal Lines (From Bin)'[itemNo] ), 'Warehouse Journal Lines (From Bin)'[itemNo], "|" ) & "'" + & " AND 'Warehouse Journal Line'.'Location Code' IS '" & LocationCode & "'", + BaseLink + ) displayFolder: _Bin Measures lineageTag: 7982ebca-d5e6-4981-8626-7925caaabf6c diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl index 9c6653511b..9698c257fe 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl @@ -80,17 +80,35 @@ table 'Item Ledger Entries' VAR Endpoint = "&page=38&" VAR BaseLink = [Base Link] & Endpoint VAR ILEBaseLink = BaseLink & "filter='Item Ledger Entry'.'Open' IS 'Yes'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Item Ledger Entries'[Item No.]),'Item Ledger Entries'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") - VAR Locations = CONCATENATEX(VALUES('Item Ledger Entries'[Location Code]), 'Item Ledger Entries'[Location Code], "|") - - VAR LocationFilter = " AND 'Item Ledger Entry'.'Location Code' IS '" & Locations & "'" - VAR ItemFilter = " AND 'Item Ledger Entry'.'Item No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( ILEBaseLink ) + + LEN ( " AND 'Item Ledger Entry'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[Item No.] ), LEN ( 'Item Ledger Entries'[Item No.] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[dimensionSetID] ), LEN ( 'Item Ledger Entries'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Location Code' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[Location Code] ), LEN ( 'Item Ledger Entries'[Location Code] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - ILEBaseLink & ItemFilter & DimensionFilter & LocationFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + ILEBaseLink + & " AND 'Item Ledger Entry'.'Item No.' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[Item No.]),'Item Ledger Entries'[Item No.], "|") & "'" + & " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") & "'" + & " AND 'Item Ledger Entry'.'Location Code' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[Location Code]), 'Item Ledger Entries'[Location Code], "|") & "'" & " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Links lineageTag: 0db0f775-f0bf-48cf-90ec-7d8a9d901d36 @@ -98,16 +116,33 @@ table 'Item Ledger Entries' VAR Endpoint = "&page=38&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Item Ledger Entries'[Item No.]),'Item Ledger Entries'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") - - - VAR ItemFilter = "filter='Item Ledger Entry'.'Item No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Item Ledger Entry'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[Item No.] ), LEN ( 'Item Ledger Entries'[Item No.] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[dimensionSetID] ), LEN ( 'Item Ledger Entries'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & ItemFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Item Ledger Entry'.'Item No.' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[Item No.]),'Item Ledger Entries'[Item No.], "|") & "'" + & " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") & "'" + & " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Links lineageTag: fd7edf49-9b06-4d6e-b6bf-693e05b7fc65 @@ -115,15 +150,33 @@ table 'Item Ledger Entries' VAR Endpoint = "&page=38&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR DimensionSetIDs = CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") + // Project the URL length from the raw filter values without building the (possibly huge) URL string VAR LotNo = SELECTEDVALUE('Item Ledger Entries'[Lot No.]) - - VAR LotNoFilter = "filter='Item Ledger Entry'.'Lot No.' IS '" & LotNo & "'" - VAR DateFilter = " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Item Ledger Entry'.'Lot No.' IS ''" ) + LEN ( LotNo ) + + LEN ( " AND 'Item Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[dimensionSetID] ), LEN ( 'Item Ledger Entries'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & LotNoFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Item Ledger Entry'.'Lot No.' IS '" & LotNo & "'" + & " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") & "'" + & " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Links lineageTag: a5f062eb-a79f-4a50-bfd4-477d6a222994 @@ -131,15 +184,33 @@ table 'Item Ledger Entries' VAR Endpoint = "&page=38&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR DimensionSetIDs = CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") + // Project the URL length from the raw filter values without building the (possibly huge) URL string VAR SerialNo = SELECTEDVALUE('Item Ledger Entries'[Serial No.]) - - VAR SerialNoFilter = "filter='Item Ledger Entry'.'Serial No.' IS '" & SerialNo & "'" - VAR DateFilter = " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Item Ledger Entry'.'Serial No.' IS ''" ) + LEN ( SerialNo ) + + LEN ( " AND 'Item Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Item Ledger Entries'[dimensionSetID] ), LEN ( 'Item Ledger Entries'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Item Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & SerialNoFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Item Ledger Entry'.'Serial No.' IS '" & SerialNo & "'" + & " AND 'Item Ledger Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Item Ledger Entries'[dimensionSetID]), 'Item Ledger Entries'[dimensionSetID], "|") & "'" + & " AND 'Item Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Links lineageTag: 1d854284-5407-4c80-b325-9b06a0de6085 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Prod Order Component Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Prod Order Component Lines.tmdl index 68e67cb246..dc7e1a560a 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Prod Order Component Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Prod Order Component Lines.tmdl @@ -19,16 +19,33 @@ table 'Prod Order Component Lines' VAR Endpoint = "&page=99000818&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Prod Order Component Lines'[itemNo]),'Prod Order Component Lines'[itemNo], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Prod Order Component Lines'[dimensionSetID]), 'Prod Order Component Lines'[dimensionSetID], "|") - - - VAR ItemFilter = "filter='Prod. Order Component'.'Item No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Prod. Order Component'.'Due Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Prod. Order Component'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Prod. Order Component'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Component Lines'[itemNo] ), LEN ( 'Prod Order Component Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Prod. Order Component'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Component Lines'[dimensionSetID] ), LEN ( 'Prod Order Component Lines'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Prod. Order Component'.'Due Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & ItemFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Prod. Order Component'.'Item No.' IS '" & CONCATENATEX(VALUES('Prod Order Component Lines'[itemNo]),'Prod Order Component Lines'[itemNo], "|") & "'" + & " AND 'Prod. Order Component'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Prod Order Component Lines'[dimensionSetID]), 'Prod Order Component Lines'[dimensionSetID], "|") & "'" + & " AND 'Prod. Order Component'.'Due Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 82762de4-408f-4bff-a747-373f8f8a9616 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Production Order Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Production Order Lines.tmdl index 636b4df821..b0a2780160 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Production Order Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Production Order Lines.tmdl @@ -106,15 +106,33 @@ table 'Production Order Lines' VAR Endpoint = "&page=99000815&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR DocumentNo = CONCATENATEX(VALUES('Production Order Lines'[Document No.]),'Production Order Lines'[Document No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Production Order Lines'[dimensionSetID]), 'Production Order Lines'[dimensionSetID], "|") - - VAR DocumentNoFilter = "filter='Production Order'.'No.' IS '" & DocumentNo & "'" - VAR DateFilter = " AND 'Production Order'.'Due Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Production Order'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Production Order'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Production Order Lines'[Document No.] ), LEN ( 'Production Order Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Production Order'.'Due Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Production Order'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Production Order Lines'[dimensionSetID] ), LEN ( 'Production Order Lines'[dimensionSetID] ) + 1 ) RETURN - BaseLink & DocumentNoFilter & DateFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Production Order'.'No.' IS '" & CONCATENATEX(VALUES('Production Order Lines'[Document No.]),'Production Order Lines'[Document No.], "|") & "'" + & " AND 'Production Order'.'Due Date' IS '" & [Ranged] & "'" + & " AND 'Production Order'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Production Order Lines'[dimensionSetID]), 'Production Order Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 8dc26dce-99b5-4e87-a429-f9d531b4729e diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Project Planning Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Project Planning Lines.tmdl index 9d2bffaaa4..a6473d9db8 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Project Planning Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Project Planning Lines.tmdl @@ -18,13 +18,30 @@ table 'Project Planning Lines' VAR Endpoint = "&page=1007&" VAR BaseLink = [Base Link] & Endpoint VAR PlanningLineBaseLink = BaseLink & "filter='Job Planning Line'.'Type' IS 'Item' " - // Filter Context - VAR ItemNo = CONCATENATEX(VALUES('Project Planning Lines'[itemNo]),'Project Planning Lines'[itemNo], "|") - - VAR ItemNoFilter = " AND 'Job Planning Line'.'No.' IS '" & ItemNo & "'" - VAR DateFilter = " AND 'Job Planning Line'.'Planning Date' IS '" & [Ranged] & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( PlanningLineBaseLink ) + + LEN ( " AND 'Job Planning Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Project Planning Lines'[itemNo] ), LEN ( 'Project Planning Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Job Planning Line'.'Planning Date' IS ''" ) + ProjectedRangedLength RETURN - PlanningLineBaseLink & ItemNoFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PlanningLineBaseLink + & " AND 'Job Planning Line'.'No.' IS '" & CONCATENATEX(VALUES('Project Planning Lines'[itemNo]),'Project Planning Lines'[itemNo], "|") & "'" + & " AND 'Job Planning Line'.'Planning Date' IS '" & [Ranged] & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 9469fbd0-0d17-444b-af4c-9772a71e60d0 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Purchase Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Purchase Lines.tmdl index 0fcf8c0f79..050713bdfb 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Purchase Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Purchase Lines.tmdl @@ -52,15 +52,33 @@ table 'Purchase Lines' VAR Endpoint = "&page=518&" VAR BaseLink = [Base Link] & Endpoint VAR OrderBaseLink = BaseLink & "filter='Purchase Line'.'Document Type' IS 'Order'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Purchase Lines'[Item No.]),'Purchase Lines'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Purchase Lines'[dimensionSetID]), 'Purchase Lines'[dimensionSetID], "|") - - VAR ItemFilter = " AND 'Purchase Line'.'No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Purchase Line'.'Order Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Purchase Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( OrderBaseLink ) + + LEN ( " AND 'Purchase Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[Item No.] ), LEN ( 'Purchase Lines'[Item No.] ) + 1 ) + + LEN ( " AND 'Purchase Line'.'Order Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Purchase Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[dimensionSetID] ), LEN ( 'Purchase Lines'[dimensionSetID] ) + 1 ) RETURN - OrderBaseLink & ItemFilter & DateFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + OrderBaseLink + & " AND 'Purchase Line'.'No.' IS '" & CONCATENATEX(VALUES('Purchase Lines'[Item No.]),'Purchase Lines'[Item No.], "|") & "'" + & " AND 'Purchase Line'.'Order Date' IS '" & [Ranged] & "'" + & " AND 'Purchase Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Purchase Lines'[dimensionSetID]), 'Purchase Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: de410091-38b3-4d67-bcdb-d206f804793c dataCategory: WebUrl @@ -70,15 +88,33 @@ table 'Purchase Lines' VAR Endpoint = "&page=518&" VAR BaseLink = [Base Link] & Endpoint VAR OrderBaseLink = BaseLink & "filter='Purchase Line'.'Document Type' IS 'Return Order'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Purchase Lines'[Item No.]),'Purchase Lines'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Purchase Lines'[dimensionSetID]), 'Purchase Lines'[dimensionSetID], "|") - - VAR ItemFilter = " AND 'Purchase Line'.'No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Purchase Line'.'Order Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Purchase Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( OrderBaseLink ) + + LEN ( " AND 'Purchase Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[Item No.] ), LEN ( 'Purchase Lines'[Item No.] ) + 1 ) + + LEN ( " AND 'Purchase Line'.'Order Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Purchase Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[dimensionSetID] ), LEN ( 'Purchase Lines'[dimensionSetID] ) + 1 ) RETURN - OrderBaseLink & ItemFilter & DateFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + OrderBaseLink + & " AND 'Purchase Line'.'No.' IS '" & CONCATENATEX(VALUES('Purchase Lines'[Item No.]),'Purchase Lines'[Item No.], "|") & "'" + & " AND 'Purchase Line'.'Order Date' IS '" & [Ranged] & "'" + & " AND 'Purchase Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Purchase Lines'[dimensionSetID]), 'Purchase Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 8e2e9ce7-f6ac-4042-b54d-7e3bc891641a diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Sales Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Sales Lines.tmdl index 973b03336b..eaac99014a 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Sales Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Sales Lines.tmdl @@ -50,15 +50,33 @@ table 'Sales Lines' VAR Endpoint = "&page=516&" VAR BaseLink = [Base Link] & Endpoint VAR OrderBaseLink = BaseLink & "filter='Sales Line'.'Document Type' IS 'Order'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Sales Lines'[Item No.]),'Sales Lines'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Sales Lines'[dimensionSetID]), 'Sales Lines'[dimensionSetID], "|") - - VAR ItemFilter = " AND 'Sales Line'.'No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Sales Line'.'Shipment Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Sales Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( OrderBaseLink ) + + LEN ( " AND 'Sales Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[Item No.] ), LEN ( 'Sales Lines'[Item No.] ) + 1 ) + + LEN ( " AND 'Sales Line'.'Shipment Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Sales Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[dimensionSetID] ), LEN ( 'Sales Lines'[dimensionSetID] ) + 1 ) RETURN - OrderBaseLink & ItemFilter & DateFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + OrderBaseLink + & " AND 'Sales Line'.'No.' IS '" & CONCATENATEX(VALUES('Sales Lines'[Item No.]),'Sales Lines'[Item No.], "|") & "'" + & " AND 'Sales Line'.'Shipment Date' IS '" & [Ranged] & "'" + & " AND 'Sales Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Sales Lines'[dimensionSetID]), 'Sales Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 717f4d77-4e83-4aaf-8df1-8fc0fc408401 @@ -67,15 +85,33 @@ table 'Sales Lines' VAR Endpoint = "&page=516&" VAR BaseLink = [Base Link] & Endpoint VAR OrderBaseLink = BaseLink & "filter='Sales Line'.'Document Type' IS 'Return Order'" - // Filter Context - VAR Items = CONCATENATEX(VALUES('Sales Lines'[Item No.]),'Sales Lines'[Item No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Sales Lines'[dimensionSetID]), 'Sales Lines'[dimensionSetID], "|") - - VAR ItemFilter = " AND 'Sales Line'.'No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Sales Line'.'Shipment Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Sales Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( OrderBaseLink ) + + LEN ( " AND 'Sales Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[Item No.] ), LEN ( 'Sales Lines'[Item No.] ) + 1 ) + + LEN ( " AND 'Sales Line'.'Shipment Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Sales Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[dimensionSetID] ), LEN ( 'Sales Lines'[dimensionSetID] ) + 1 ) RETURN - OrderBaseLink & ItemFilter & DateFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + OrderBaseLink + & " AND 'Sales Line'.'No.' IS '" & CONCATENATEX(VALUES('Sales Lines'[Item No.]),'Sales Lines'[Item No.], "|") & "'" + & " AND 'Sales Line'.'Shipment Date' IS '" & [Ranged] & "'" + & " AND 'Sales Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Sales Lines'[dimensionSetID]), 'Sales Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: d051088a-53de-4963-883d-6c6c34714bcf diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Service Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Service Lines.tmdl index 0e69e61e77..7e89123250 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Service Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Service Lines.tmdl @@ -22,14 +22,22 @@ table 'Service Lines' VAR Endpoint = "&page=5907&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR DocumentNo = CONCATENATEX(VALUES('Service Lines'[Document No.]),'Service Lines'[Document No.], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Service Lines'[dimensionSetID]), 'Service Lines'[dimensionSetID], "|") - - VAR DocumentNoFilter = "filter='Service Line'.'Document No.' IS '" & DocumentNo & "'" - VAR DimensionFilter = " AND 'Service Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Service Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Service Lines'[Document No.] ), LEN ( 'Service Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Service Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Service Lines'[dimensionSetID] ), LEN ( 'Service Lines'[dimensionSetID] ) + 1 ) RETURN - BaseLink & DocumentNoFilter & DimensionFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Service Line'.'Document No.' IS '" & CONCATENATEX(VALUES('Service Lines'[Document No.]),'Service Lines'[Document No.], "|") & "'" + & " AND 'Service Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Service Lines'[dimensionSetID]), 'Service Lines'[dimensionSetID], "|") & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: d78656af-d260-4205-a5b7-fd3471197afa diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Transfer Lines.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Transfer Lines.tmdl index 9ff306d42b..81916eb04d 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Transfer Lines.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Transfer Lines.tmdl @@ -67,18 +67,35 @@ table 'Transfer Lines' VAR Endpoint = "&page=5749&" VAR BaseLink = [Base Link] & Endpoint - // Filter Context - VAR Items = CONCATENATEX(VALUES('Transfer Lines'[itemNo]),'Transfer Lines'[itemNo], "|") - VAR DimensionSetIDs = CONCATENATEX(VALUES('Transfer Lines'[dimensionSetID]), 'Transfer Lines'[dimensionSetID], "|") + // Project the URL length from the raw filter values without building the (possibly huge) URL string VAR Location = SELECTEDVALUE('Transfer Lines'[Transfer From Location Code]) - - VAR ItemFilter = "filter='Transfer Line'.'Item No.' IS '" & Items & "'" - VAR DateFilter = " AND 'Transfer Line'.'Shipment Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Transfer Line'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" - VAR LocationFilter = " AND 'Transfer Line'.'Transfer-from Code' IS '" & Location & "'" - + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Transfer Line'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Transfer Lines'[itemNo] ), LEN ( 'Transfer Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Transfer Line'.'Shipment Date' IS ''" ) + ProjectedRangedLength + + LEN ( " AND 'Transfer Line'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Transfer Lines'[dimensionSetID] ), LEN ( 'Transfer Lines'[dimensionSetID] ) + 1 ) + + LEN ( " AND 'Transfer Line'.'Transfer-from Code' IS ''" ) + LEN ( Location ) RETURN - BaseLink & ItemFilter & DateFilter & DimensionFilter & LocationFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + BaseLink + & "filter='Transfer Line'.'Item No.' IS '" & CONCATENATEX(VALUES('Transfer Lines'[itemNo]),'Transfer Lines'[itemNo], "|") & "'" + & " AND 'Transfer Line'.'Shipment Date' IS '" & [Ranged] & "'" + & " AND 'Transfer Line'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Transfer Lines'[dimensionSetID]), 'Transfer Lines'[dimensionSetID], "|") & "'" & " AND 'Transfer Line'.'Transfer-from Code' IS '" & Location & "'", + BaseLink + ) displayFolder: _Back Link lineageTag: 68ec7ae9-c366-436b-98d3-8638a543c464 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl index 48c0d33952..a0c12753f6 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl @@ -19,21 +19,39 @@ table 'Back Links' VAR Endpoint = "&page=99000759&" VAR baseLink = [Base Link] & Endpoint - // Build filter context - VAR WorkCenters = - CONCATENATEX(VALUES ( 'Calendar Entries'[No.] ), 'Calendar Entries'[No.], "|" ) + // Build filter context(transformed low-cardinality values only ) VAR CapacityTypePrep = CONCATENATEX(VALUES ( 'Calendar Entries'[Capacity Type] ), 'Calendar Entries'[Capacity Type], "|" ) VAR CapacityType = SUBSTITUTE(SUBSTITUTE(CapacityTypePrep, "Work Center", "0"), "Machine Center","1") - // Build URL string components - VAR CapacityTypeFilter = "filter='Calendar Entry'.'Capacity Type' IS " & "'" & CapacityType & "'" - VAR WorkCenterFilter = " AND 'Calendar Entry'.'No.' IS " & WorkCenters - VAR CalednarEntryPostingDateFilter = " AND 'Calendar Entry'.'Date' IS " & [Ranged] - + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='Calendar Entry'.'Capacity Type' IS ''" ) + LEN ( CapacityType ) + + LEN ( " AND 'Calendar Entry'.'No.' IS " ) + + SUMX ( VALUES ( 'Calendar Entries'[No.] ), LEN ( 'Calendar Entries'[No.] ) + 1 ) + + LEN ( " AND 'Calendar Entry'.'Date' IS " ) + ProjectedRangedLength RETURN - baseLink & CapacityTypeFilter & WorkCenterFilter & CalednarEntryPostingDateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='Calendar Entry'.'Capacity Type' IS " & "'" & CapacityType & "'" + & " AND 'Calendar Entry'.'No.' IS " & CONCATENATEX(VALUES ( 'Calendar Entries'[No.] ), 'Calendar Entries'[No.], "|" ) + & " AND 'Calendar Entry'.'Date' IS " & [Ranged], + baseLink + ) ``` isHidden lineageTag: 08219a66-0acd-42a9-8e13-5380f953c9a2 @@ -118,36 +136,51 @@ table 'Back Links' VAR Endpoint = "&page=99000820&" VAR baseLink = [Base Link] & Endpoint - // Build filter context - VAR WorkCenters = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), 'Prod Order Capacity Need'[workCenterNo], "|" ) - VAR Nos = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[no] ), 'Prod Order Capacity Need'[no], "|" ) - VAR Types = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Type] ), 'Prod Order Capacity Need'[Type], "|" ) - - VAR ProdOrderStatus = - CONCATENATEX(VALUES( 'Production Orders'[Prod Order Status]), 'Production Orders'[Prod Order Status], "|" ) - - VAR ProdOrders = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), 'Prod Order Capacity Need'[Prod. Order No.], "|" ) + // Build filter context(transformed low-cardinality values only ) VAR RequestedOnlyInput = CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Requested Only] ), 'Prod Order Capacity Need'[Requested Only], "|" ) VAR RequestedOnly = SUBSTITUTE(SUBSTITUTE(RequestedOnlyInput, "FALSE", "0"), "TRUE","1") - // Build URL string components - VAR WorkCenterFilter = "filter='Prod. Order Capacity Need'.'Work Center No.' IS " & "'" & WorkCenters & "'" - VAR ProdOrderFilter = " AND 'Prod. Order Capacity Need'.'Prod. Order No.' IS " & "'" & ProdOrders & "'" - VAR ProdOrderStatusFilter = " AND 'Prod. Order Capacity Need'.'Status' IS " & "'" & ProdOrderStatus & "'" - VAR NoFilter = " AND 'Prod. Order Capacity Need'.'No.' IS " & "'" & Nos & "'" - VAR TypesFilter = " AND 'Prod. Order Capacity Need'.'Type' IS " & "'" & Types & "'" - VAR DateFilter = " AND 'Prod. Order Capacity Need'.'Date' IS " & [Ranged] - VAR RequestedOnlyFilter = " AND 'Prod. Order Capacity Need'.'Requested Only' IS " & "'" & RequestedOnly & "'" - + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='Prod. Order Capacity Need'.'Work Center No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), LEN ( 'Prod Order Capacity Need'[workCenterNo] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[no] ), LEN ( 'Prod Order Capacity Need'[no] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Type' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[Type] ), LEN ( 'Prod Order Capacity Need'[Type] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Prod. Order Capacity Need'.'Prod. Order No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), LEN ( 'Prod Order Capacity Need'[Prod. Order No.] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Status' IS ''" ) + + SUMX ( VALUES ( 'Production Orders'[Prod Order Status] ), LEN ( 'Production Orders'[Prod Order Status] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Requested Only' IS ''" ) + LEN ( RequestedOnly ) RETURN - baseLink & WorkCenterFilter & NoFilter & TypesFilter & DateFilter & ProdOrderFilter & ProdOrderStatusFilter & RequestedOnlyFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='Prod. Order Capacity Need'.'Work Center No.' IS " & "'" & CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), 'Prod Order Capacity Need'[workCenterNo], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'No.' IS " & "'" & CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[no] ), 'Prod Order Capacity Need'[no], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'Type' IS " & "'" & CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Type] ), 'Prod Order Capacity Need'[Type], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'Date' IS " & [Ranged] + & " AND 'Prod. Order Capacity Need'.'Prod. Order No.' IS " & "'" & CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), 'Prod Order Capacity Need'[Prod. Order No.], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'Status' IS " & "'" & CONCATENATEX(VALUES( 'Production Orders'[Prod Order Status]), 'Production Orders'[Prod Order Status], "|" ) & "'" & " AND 'Prod. Order Capacity Need'.'Requested Only' IS " & "'" & RequestedOnly & "'", + baseLink + ) ``` isHidden lineageTag: ebbde43d-0b1a-4736-8c3c-71e9a3180437 @@ -159,24 +192,41 @@ table 'Back Links' VAR Endpoint = "&page=99000820&" VAR baseLink = [Base Link] & Endpoint - // Build filter context - VAR WorkCenters = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), 'Prod Order Capacity Need'[workCenterNo], "|" ) - VAR Nos = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[no] ), 'Prod Order Capacity Need'[no], "|" ) - VAR Types = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Type] ), 'Prod Order Capacity Need'[Type], "|" ) - - - // Build URL string components - VAR WorkCenterFilter = "filter='Prod. Order Capacity Need'.'Work Center No.' IS " & "'" & WorkCenters & "'" - VAR NoFilter = " AND 'Prod. Order Capacity Need'.'No.' IS " & "'" & Nos & "'" - VAR TypesFilter = " AND 'Prod. Order Capacity Need'.'Type' IS " & "'" & Types & "'" - VAR DateFilter = " AND 'Prod. Order Capacity Need'.'Date' IS " & [Ranged] - VAR RequestedOnlyFilter = " AND 'Prod. Order Capacity Need'.'Requested Only' IS 'No'" - + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='Prod. Order Capacity Need'.'Work Center No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), LEN ( 'Prod Order Capacity Need'[workCenterNo] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[no] ), LEN ( 'Prod Order Capacity Need'[no] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Type' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[Type] ), LEN ( 'Prod Order Capacity Need'[Type] ) + 1 ) + + LEN ( " AND 'Prod. Order Capacity Need'.'Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Prod. Order Capacity Need'.'Requested Only' IS 'No'" ) RETURN - baseLink & WorkCenterFilter & NoFilter & TypesFilter & DateFilter & RequestedOnlyFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='Prod. Order Capacity Need'.'Work Center No.' IS " & "'" & + CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[workCenterNo] ), 'Prod Order Capacity Need'[workCenterNo], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'No.' IS " & "'" & + CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[no] ), 'Prod Order Capacity Need'[no], "|" ) & "'" + & " AND 'Prod. Order Capacity Need'.'Type' IS " & "'" & + CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Type] ), 'Prod Order Capacity Need'[Type], "|" ) & "'" & " AND 'Prod. Order Capacity Need'.'Date' IS " & [Ranged] + & " AND 'Prod. Order Capacity Need'.'Requested Only' IS 'No'", + baseLink + ) ``` isHidden lineageTag: 260ab712-b2d0-481a-b1d1-9ddf9ed984a1 @@ -188,15 +238,20 @@ table 'Back Links' VAR Endpoint = "&page=5832&" VAR baseLink = [Base Link] & Endpoint - // Build filter context - VAR ProdOrders = - CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), 'Prod Order Capacity Need'[Prod. Order No.], "|" ) - - // Build URL string components - VAR CapacityTypeFilter = "filter='Capacity Ledger Entry'.'Order No.' IS " & "'" & ProdOrders & "'" - + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( baseLink ) + + LEN ( "filter='Capacity Ledger Entry'.'Order No.' IS ''" ) + + SUMX ( VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), LEN ( 'Prod Order Capacity Need'[Prod. Order No.] ) + 1 ) RETURN - baseLink & CapacityTypeFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + baseLink + & "filter='Capacity Ledger Entry'.'Order No.' IS " & "'" & + CONCATENATEX(VALUES ( 'Prod Order Capacity Need'[Prod. Order No.] ), 'Prod Order Capacity Need'[Prod. Order No.], "|" ) & "'", + baseLink + ) ``` isHidden lineageTag: 5b769c7e-3d21-40ae-922e-ffbc42a4bc3a diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl index e5548a7574..5062c67fed 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl @@ -133,11 +133,27 @@ table Project VAR ProjectTaskNos = CONCATENATEX(VALUES('Project Planning Line'[Task No.]), 'Project Planning Line'[Task No.], "|") VAR LineNos = CONCATENATEX(VALUES('Project Planning Line'[Line No.]), 'Project Planning Line'[Line No.], "|") - RETURN + VAR PageLink = [Base Link] - & "&page=1007&filter='Job Planning Line'.'Job No.' IS '" & ProjectNos & "'" - & " AND 'Job Planning Line'.'Job Task No.' IS '" & ProjectTaskNos & "'" - & " AND 'Job Planning Line'.'Line No.' IS '" & LineNos & "'" + & "&page=1007" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Job Planning Line'.'Job No.' IS ''" ) + + SUMX ( VALUES ( 'Project Planning Line'[Project No.] ), LEN ( 'Project Planning Line'[Project No.] ) + 1 ) + + LEN ( " AND 'Job Planning Line'.'Job Task No.' IS ''" ) + + SUMX ( VALUES ( 'Project Planning Line'[Task No.] ), LEN ( 'Project Planning Line'[Task No.] ) + 1 ) + + LEN ( " AND 'Job Planning Line'.'Line No.' IS ''" ) + + SUMX ( VALUES ( 'Project Planning Line'[Line No.] ), LEN ( 'Project Planning Line'[Line No.] ) + 1 ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PageLink & "&filter='Job Planning Line'.'Job No.' IS '" & CONCATENATEX(VALUES('Project Planning Line'[Project No.]), 'Project Planning Line'[Project No.], "|") & "'" + & " AND 'Job Planning Line'.'Job Task No.' IS '" & CONCATENATEX(VALUES('Project Planning Line'[Task No.]), 'Project Planning Line'[Task No.], "|") & "'" + & " AND 'Job Planning Line'.'Line No.' IS '" & CONCATENATEX(VALUES('Project Planning Line'[Line No.]), 'Project Planning Line'[Line No.], "|") & "'", + PageLink + ) ``` isHidden displayFolder: _Project Measures\Back Links @@ -163,13 +179,33 @@ table Project VAR EntryTypes = CONCATENATEX(VALUES('Project Ledger Entry'[Entry Type]), 'Project Ledger Entry'[Entry Type], "|") VAR Types = CONCATENATEX(VALUES('Project Ledger Entry'[Type]), 'Project Ledger Entry'[Type], "|") - RETURN + VAR PageLink = [Base Link] - & "&page=92&filter='Job Ledger Entry'.'Job No.' IS '" & ProjectNos & "'" - & " AND 'Job Ledger Entry'.'Job Task No.' IS '" & ProjectTaskNos & "'" - & " AND 'Job Ledger Entry'.'Entry Type' IS '" & EntryTypes & "'" - & " AND 'Job Ledger Entry'.'Type' IS '" & Types & "'" - & " AND 'Job Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + & "&page=92" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Job Ledger Entry'.'Job No.' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entry'[Project No.] ), LEN ( 'Project Ledger Entry'[Project No.] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Job Task No.' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entry'[Task No.] ), LEN ( 'Project Ledger Entry'[Task No.] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Entry Type' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entry'[Entry Type] ), LEN ( 'Project Ledger Entry'[Entry Type] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Type' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entry'[Type] ), LEN ( 'Project Ledger Entry'[Type] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entry'[Dimension Set ID.] ), LEN ( 'Project Ledger Entry'[Dimension Set ID.] ) + 1 ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PageLink & "&filter='Job Ledger Entry'.'Job No.' IS '" & CONCATENATEX(VALUES('Project Ledger Entry'[Project No.]), 'Project Ledger Entry'[Project No.], "|") & "'" + & " AND 'Job Ledger Entry'.'Job Task No.' IS '" & CONCATENATEX(VALUES('Project Ledger Entry'[Task No.]), 'Project Ledger Entry'[Task No.], "|") & "'" + & " AND 'Job Ledger Entry'.'Entry Type' IS '" & CONCATENATEX(VALUES('Project Ledger Entry'[Entry Type]), 'Project Ledger Entry'[Entry Type], "|") & "'" + & " AND 'Job Ledger Entry'.'Type' IS '" & CONCATENATEX(VALUES('Project Ledger Entry'[Type]), 'Project Ledger Entry'[Type], "|") & "'" + & " AND 'Job Ledger Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Project Ledger Entry'[Dimension Set ID.]), 'Project Ledger Entry'[Dimension Set ID.], "|") & "'", + PageLink + ) ``` isHidden displayFolder: _Project Measures\Back Links diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl index 6fe18240a7..238358db3a 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl @@ -83,9 +83,6 @@ table Documents // --- Purchase Lines -- - VAR PurchaseLineDocumentNos = CONCATENATEX(VALUES('Purchase Lines'[Document No.]), 'Purchase Lines'[Document No.], "|") - VAR PurchaseLineItems = CONCATENATEX(VALUES('Purchase Lines'[itemNo]), 'Purchase Lines'[itemNo], "|") - // --- Document Type concatenation --- VAR DistinctPurchaseLineDocTypes = DISTINCT ( SELECTCOLUMNS ( 'Purchase Lines', "Document Type", 'Purchase Lines'[Document Type] ) ) @@ -100,9 +97,6 @@ table Documents ) ) - VAR PurchaseLineDocumentTypes = - CONCATENATEX ( PurchaseLineDocTypesWithValues, [DocTypeValue], "|" ) - // --- Line Type concatenation --- VAR DistinctPurchaseLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Purchase Lines', "Line Type", 'Purchase Lines'[Type] ) ) @@ -117,16 +111,7 @@ table Documents ) ) - VAR PurchaseLineTypes = - CONCATENATEX ( PurchaseLineTypesWithValues, [LineTypeValue], "|" ) - // --- Purchase Value Entries --- - VAR PurchaseValueEntriesItems = - CONCATENATEX(VALUES('Purchase Value Entries'[itemNo]), 'Purchase Value Entries'[itemNo], "|") - - VAR PurchaseValueEntriesDocumentNos = - CONCATENATEX(VALUES('Purchase Value Entries'[Document No.]), 'Purchase Value Entries'[Document No.], "|") - // --- Purchase Value Entry Document Type concatenation --- VAR DistinctPurchaseValueEntryDocTypes = DISTINCT ( SELECTCOLUMNS ( 'Purchase Value Entries', "Document Type", 'Purchase Value Entries'[Document Type] ) ) @@ -141,15 +126,7 @@ table Documents ) ) - VAR PurchaseValueEntriesDocumentTypes = - CONCATENATEX ( PurchaseValueEntryDocTypesWithValues, [DocTypeValue], "|" ) - // --- Purchase Invoice Lines --- - VAR PurchaseInvoiceLineDocumentNos = - CONCATENATEX(VALUES('Purchase Invoice Lines'[Document No.]), 'Purchase Invoice Lines'[Document No.], "|") - VAR PurchaseInvoiceLineItems = - CONCATENATEX(VALUES('Purchase Invoice Lines'[No]), 'Purchase Invoice Lines'[No], "|") - // --- Line Type concatenation --- VAR DistinctPurchaseInvoiceLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Purchase Invoice Lines', "Line Type", 'Purchase Invoice Lines'[Type] ) ) @@ -164,13 +141,7 @@ table Documents ) ) - VAR PurchaseInvoiceLineTypes = - CONCATENATEX ( PurchaseInvoiceLineTypesWithValues, [LineTypeValue], "|" ) - // --- Purchase Credit Lines --- - VAR PurchaseCreditLineDocumentNos = CONCATENATEX(VALUES('Purchase Credit Lines'[Document No.]), 'Purchase Credit Lines'[Document No.], "|") - VAR PurchaseCreditLineItems = CONCATENATEX(VALUES('Purchase Credit Lines'[No]), 'Purchase Credit Lines'[No], "|") - // --- Line Type concatenation --- VAR DistinctPurchaseCreditLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Purchase Credit Lines', "Line Type", 'Purchase Credit Lines'[Type] ) ) @@ -184,15 +155,99 @@ table Documents 'Purchase Line Type'[Caption], [Line Type] ) ) + + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS ( + VALUES ( 'Dimension Sets'[dimensionSetID] ), + "DimensionSetID", IF ( ISBLANK ( 'Dimension Sets'[dimensionSetID] ), 0, 'Dimension Sets'[dimensionSetID] ) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each normalized run by (2 * widest selected ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) - VAR PurchaseCreditLineTypes = - CONCATENATEX ( PurchaseCreditLineTypesWithValues, [LineTypeValue], "|" ) + VAR _PageOnly = + SWITCH( + SELECTEDVALUE('Documents'[Source Table]), + "Purchase Lines", [Base Link] & "&page=518", + "Purchase Value Entries", [Base Link] & "&page=5802", + "Purchase Invoice Line", [Base Link] & "&page=529", + "Purchase Credit Line", [Base Link] & "&page=530" + ) + // Project the URL length per branch from the component values without building the (possibly huge) URL string + VAR ProjectedLength = + SWITCH( + SELECTEDVALUE('Documents'[Source Table]), + "Purchase Lines", + LEN ( [Base Link] ) + LEN ( "&page=518&filter='Purchase Line'.'Document Type' IS ''" ) + + SUMX ( PurchaseLineDocTypesWithValues, LEN ( [DocTypeValue] ) + 1 ) + + LEN ( " AND 'Purchase Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[Document No.] ), LEN ( 'Purchase Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Purchase Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Purchase Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Lines'[itemNo] ), LEN ( 'Purchase Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Purchase Line'.'Type' IS ''" ) + + SUMX ( PurchaseLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ), + "Purchase Value Entries", + LEN ( [Base Link] ) + LEN ( "&page=5802&filter='Value Entry'.'Item Ledger Entry Type' IS '0|7'" ) + + LEN ( " AND 'Value Entry'.'Entry Type' IS '0'" ) + + LEN ( " AND 'Value Entry'.'Adjustment' IS '0'" ) + + LEN ( " AND 'Value Entry'.'Document Type' IS ''" ) + + SUMX ( PurchaseValueEntryDocTypesWithValues, LEN ( [DocTypeValue] ) + 1 ) + + LEN ( " AND 'Value Entry'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Value Entries'[Document No.] ), LEN ( 'Purchase Value Entries'[Document No.] ) + 1 ) + + LEN ( " AND 'Value Entry'.'Posting Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Value Entry'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Value Entry'.'Item No.' IS '" ) + + SUMX ( VALUES ( 'Purchase Value Entries'[itemNo] ), LEN ( 'Purchase Value Entries'[itemNo] ) + 1 ) + + LEN ( "|''''" ) + LEN ( "'" ), + "Purchase Invoice Line", + LEN ( [Base Link] ) + LEN ( "&page=529&filter='Purch. Inv. Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Invoice Lines'[Document No.] ), LEN ( 'Purchase Invoice Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Purch. Inv. Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Purch. Inv. Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Invoice Lines'[No] ), LEN ( 'Purchase Invoice Lines'[No] ) + 1 ) + + LEN ( " AND 'Purch. Inv. Line'.'Type' IS ''" ) + + SUMX ( PurchaseInvoiceLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ), + "Purchase Credit Line", + LEN ( [Base Link] ) + LEN ( "&page=530&filter='Purch. Cr. Memo Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Credit Lines'[Document No.] ), LEN ( 'Purchase Credit Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Purch. Cr. Memo Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Purch. Cr. Memo Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Purchase Credit Lines'[No] ), LEN ( 'Purchase Credit Lines'[No] ) + 1 ) + + LEN ( " AND 'Purch. Cr. Memo Line'.'Type' IS ''" ) + + SUMX ( PurchaseCreditLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ) + ) - RETURN + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, SWITCH( SELECTEDVALUE('Documents'[Source Table]), "Purchase Lines", + VAR PurchaseLineDocumentTypes = CONCATENATEX ( PurchaseLineDocTypesWithValues, [DocTypeValue], "|" ) + VAR PurchaseLineDocumentNos = CONCATENATEX ( VALUES ( 'Purchase Lines'[Document No.] ), 'Purchase Lines'[Document No.], "|" ) + VAR PurchaseLineItems = CONCATENATEX ( VALUES ( 'Purchase Lines'[itemNo] ), 'Purchase Lines'[itemNo], "|" ) + VAR PurchaseLineTypes = CONCATENATEX ( PurchaseLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=518&filter='Purchase Line'.'Document Type' IS '" & PurchaseLineDocumentTypes & "'" & " AND 'Purchase Line'.'Document No.' IS '" & PurchaseLineDocumentNos & "'" @@ -200,6 +255,10 @@ table Documents & " AND 'Purchase Line'.'No.' IS '" & PurchaseLineItems & "'" & " AND 'Purchase Line'.'Type' IS '" & PurchaseLineTypes & "'", "Purchase Value Entries", + VAR PurchaseValueEntriesDocumentTypes = CONCATENATEX ( PurchaseValueEntryDocTypesWithValues, [DocTypeValue], "|" ) + VAR PurchaseValueEntriesDocumentNos = CONCATENATEX ( VALUES ( 'Purchase Value Entries'[Document No.] ), 'Purchase Value Entries'[Document No.], "|" ) + VAR PurchaseValueEntriesItems = CONCATENATEX ( VALUES ( 'Purchase Value Entries'[itemNo] ), 'Purchase Value Entries'[itemNo], "|" ) + RETURN [Base Link] & "&page=5802&filter='Value Entry'.'Item Ledger Entry Type' IS '0|7'" & " AND 'Value Entry'.'Entry Type' IS '0'" & " AND 'Value Entry'.'Adjustment' IS '0'" @@ -209,17 +268,27 @@ table Documents & " AND 'Value Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Value Entry'.'Item No.' IS '" & PurchaseValueEntriesItems & "|''''" & "'", "Purchase Invoice Line", + VAR PurchaseInvoiceLineDocumentNos = CONCATENATEX ( VALUES ( 'Purchase Invoice Lines'[Document No.] ), 'Purchase Invoice Lines'[Document No.], "|" ) + VAR PurchaseInvoiceLineItems = CONCATENATEX ( VALUES ( 'Purchase Invoice Lines'[No] ), 'Purchase Invoice Lines'[No], "|" ) + VAR PurchaseInvoiceLineTypes = CONCATENATEX ( PurchaseInvoiceLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=529&filter='Purch. Inv. Line'.'Document No.' IS '" & PurchaseInvoiceLineDocumentNos & "'" & " AND 'Purch. Inv. Line'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Purch. Inv. Line'.'No.' IS '" & PurchaseInvoiceLineItems & "'" & " AND 'Purch. Inv. Line'.'Type' IS '" & PurchaseInvoiceLineTypes & "'", "Purchase Credit Line", + VAR PurchaseCreditLineDocumentNos = CONCATENATEX ( VALUES ( 'Purchase Credit Lines'[Document No.] ), 'Purchase Credit Lines'[Document No.], "|" ) + VAR PurchaseCreditLineItems = CONCATENATEX ( VALUES ( 'Purchase Credit Lines'[No] ), 'Purchase Credit Lines'[No], "|" ) + VAR PurchaseCreditLineTypes = CONCATENATEX ( PurchaseCreditLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=530&filter='Purch. Cr. Memo Line'.'Document No.' IS '" & PurchaseCreditLineDocumentNos & "'" & " AND 'Purch. Cr. Memo Line'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Purch. Cr. Memo Line'.'No.' IS '" & PurchaseCreditLineItems & "'" & " AND 'Purch. Cr. Memo Line'.'Type' IS '" & PurchaseCreditLineTypes & "'" + ), + _PageOnly ) ``` displayFolder: _Purchase Measures\_Back Links @@ -298,75 +367,36 @@ table Documents measure 'Ranged Dimensions' = ``` - VAR _FilterTable = VALUES('Dimension Sets'[dimensionSetID]) - VAR IndexedDimSetID = - ADDCOLUMNS( - _FilterTable, - "@Index", RANKX( - SUMMARIZECOLUMNS( - 'Dimension Sets'[dimensionSetID], _FilterTable - ), - 'Dimension Sets'[dimensionSetID], - , - ASC, - DENSE - ) + VAR NormalizedIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) ) - - VAR PreviousIndexedDimSetID = - ADDCOLUMNS( - IndexedDimSetID, - "@Previous Date", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = PrevIndex), - [dimensionSetID]) - ) - - VAR CalculateBreakPoint = - ADDCOLUMNS( - PreviousIndexedDimSetID, - "@Break Point", - IF( NOT 'Dimension Sets'[dimensionSetID] - [@Previous Date] = 1, TRUE(), FALSE() - ) + VAR DistinctIDs = DISTINCT(NormalizedIDs) + VAR MaxID = MAXX(DistinctIDs, [DimensionSetID]) + VAR RangeStarts = + FILTER( + DistinctIDs, + VAR CurrentID = [DimensionSetID] + RETURN COUNTROWS(FILTER(DistinctIDs, [DimensionSetID] = CurrentID - 1)) = 0 ) - - VAR BreakPointTable = FILTER(CalculateBreakPoint, [@Break Point] = TRUE()) - - VAR MaxDimension = CALCULATE(MAX('Dimension Sets'[dimensionSetID]),_FilterTable) - - var NextIndex = + VAR RangeEnds = ADDCOLUMNS( - BreakPointTable, - "@NextIndex", - SELECTCOLUMNS( - OFFSET( +1, BreakPointTable ), - [@Index] - ) - 1 + RangeStarts, + "@RangeEnd", + VAR CurrentStart = [DimensionSetID] + VAR NextStart = MINX(FILTER(RangeStarts, [DimensionSetID] > CurrentStart), [DimensionSetID]) + RETURN IF(ISBLANK(NextStart), MaxID, MAXX(FILTER(DistinctIDs, [DimensionSetID] < NextStart), [DimensionSetID])) ) - - VAR NextDimension = + VAR Ranges = ADDCOLUMNS( - NextIndex, - "@NextDimension", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = [@NextIndex]), - 'Dimension Sets'[dimensionSetID]) - ) - - VAR Ranged = - ADDCOLUMNS( - NextDimension, - "@Range", - IF( ISBLANK([@NextDimension]), - 'Dimension Sets'[dimensionSetID] & ".." & MaxDimension , - 'Dimension Sets'[dimensionSetID] & ".." & [@NextDimension] + RangeEnds, + "@Range", + IF([DimensionSetID] = [@RangeEnd], [DimensionSetID] & "", [DimensionSetID] & ".." & [@RangeEnd]) ) - ) Return - IF(COUNTROWS(NextDimension) = 1, MaxDimension, CONCATENATEX(Ranged, [@Range], "|")) + CONCATENATEX(Ranges, [@Range], "|", [DimensionSetID], ASC) ``` displayFolder: _Purchase Measures\_Back Links lineageTag: b9b5979a-bcce-45e4-a520-13299d19fc61 @@ -426,4 +456,3 @@ table Documents annotation PBI_NavigationStepName = Navigation annotation PBI_ResultType = Table - diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl index 52075b48bd..9ae47b84ed 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl @@ -95,11 +95,6 @@ table Documents // --- Sales Lines -- - VAR SalesLineDocumentNos = - CONCATENATEX(VALUES('Sales Lines'[Document No.]), 'Sales Lines'[Document No.], "|") - VAR SalesLineItems = - CONCATENATEX( VALUES('Sales Lines'[itemNo]), 'Sales Lines'[itemNo], "|") - // --- Document Type concatenation --- VAR DistinctSaleLineDocTypes = DISTINCT ( SELECTCOLUMNS ( 'Sales Lines', "Document Type", 'Sales Lines'[Document Type] ) ) @@ -114,9 +109,6 @@ table Documents ) ) - VAR SalesLineDocumentTypes = - CONCATENATEX ( SalesLineDocTypesWithValues, [DocTypeValue], "|" ) - // --- Line Type concatenation --- VAR DistinctSalesLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Sales Lines', "Line Type", 'Sales Lines'[Type] ) ) @@ -131,15 +123,7 @@ table Documents ) ) - VAR SalesLineTypes = - CONCATENATEX ( SalesLineTypesWithValues, [LineTypeValue], "|" ) - // --- Sales Value Entries --- - VAR SalesValueEntriesDocumentNos = - CONCATENATEX(VALUES('Sales Value Entries'[Document No.]), 'Sales Value Entries'[Document No.], "|") - VAR SalesValueEntriesItems = - CONCATENATEX(VALUES('Sales Value Entries'[itemNo]), 'Sales Value Entries'[itemNo], "|") - // --- Sales Value Enntry Document Type concatenation --- VAR DistinctSaleValueEntryDocTypes = DISTINCT ( SELECTCOLUMNS ( 'Sales Value Entries', "Document Type", 'Sales Value Entries'[Document Type] ) ) @@ -154,16 +138,7 @@ table Documents ) ) - VAR SalesValueEntryDocumentTypes = - CONCATENATEX ( SalesValueEntryDocTypesWithValues, [DocTypeValue], "|" ) - // --- Sales Invoice Lines --- - - VAR SalesInvoiceLineDocumentNos = - CONCATENATEX(VALUES('Sales Invoice Lines'[Document No.]), 'Sales Invoice Lines'[Document No.], "|") - VAR SalesInvoiceLineItems = - CONCATENATEX(VALUES('Sales Invoice Lines'[No]), 'Sales Invoice Lines'[No], "|") - // --- Line Type concatenation --- VAR DistinctSalesInvoiceLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Sales Invoice Lines', "Line Type", 'Sales Invoice Lines'[Type] ) ) @@ -178,13 +153,7 @@ table Documents ) ) - VAR SalesInvoiceLineTypes = - CONCATENATEX ( SalesInvoiceLineTypesWithValues, [LineTypeValue], "|" ) - // --- Sales Credit Lines --- - VAR SalesCreditLineDocumentNos = CONCATENATEX(VALUES('Sales Credit Lines'[Document No.]), 'Sales Credit Lines'[Document No.], "|") - VAR SalesCreditLineItems = CONCATENATEX(VALUES('Sales Credit Lines'[No]), 'Sales Credit Lines'[No], "|") - // --- Line Type concatenation --- VAR DistinctSalesCreditLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Sales Credit Lines', "Line Type", 'Sales Credit Lines'[Type] ) ) @@ -199,14 +168,7 @@ table Documents ) ) - VAR SalesCreditLineTypes = - CONCATENATEX ( SalesCreditLineTypesWithValues, [LineTypeValue], "|" ) - // --- Project Lines --- - VAR ProjectLedgerEntryDocumentNos = CONCATENATEX(VALUES('Project Ledger Entries'[Document No.]), 'Project Ledger Entries'[Document No.], "|") - VAR ProjectLedgerEntryProjectNos = CONCATENATEX(VALUES('Project Ledger Entries'[projectNo]), 'Project Ledger Entries'[projectNo], "|") - VAR ProjectLedgerEntryItems = CONCATENATEX(VALUES('Project Ledger Entries'[No]), 'Project Ledger Entries'[No], "|") - // --- Line Type concatenation --- VAR DistinctProjectLedgerLineTypes = DISTINCT ( SELECTCOLUMNS ( 'Project Ledger Entries', "Line Type", 'Project Ledger Entries'[Type] ) ) @@ -220,14 +182,106 @@ table Documents 'Project Journal Line Type'[Caption], [Line Type] ) ) + + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS ( + VALUES ( 'Dimension Sets'[dimensionSetID] ), + "DimensionSetID", IF ( ISBLANK ( 'Dimension Sets'[dimensionSetID] ), 0, 'Dimension Sets'[dimensionSetID] ) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each normalized run by (2 * widest selected ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) - VAR ProjectLedgerEntryTypes = - CONCATENATEX ( SalesLineTypesWithValues, [LineTypeValue], "|" ) + VAR _PageOnly = + SWITCH( + SELECTEDVALUE('Documents'[Source Table]), + "Sales Line", [Base Link] & "&page=516", + "Sales Value Entries", [Base Link] & "&page=5802", + "Sales Invoice Line", [Base Link] & "&page=526", + "Sales Credit Line", [Base Link] & "&page=527", + "Project Ledger Entry", [Base Link] & "&page=92" + ) + // Project the URL length per branch from the component values without building the (possibly huge) URL string + VAR ProjectedLength = + SWITCH( + SELECTEDVALUE('Documents'[Source Table]), + "Sales Line", + LEN ( [Base Link] ) + LEN ( "&page=516&filter='Sales Line'.'Document Type' IS ''" ) + + SUMX ( SalesLineDocTypesWithValues, LEN ( [DocTypeValue] ) + 1 ) + + LEN ( " AND 'Sales Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[Document No.] ), LEN ( 'Sales Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Sales Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Sales Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Lines'[itemNo] ), LEN ( 'Sales Lines'[itemNo] ) + 1 ) + + LEN ( " AND 'Sales Line'.'Type' IS ''" ) + + SUMX ( SalesLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ), + "Sales Value Entries", + LEN ( [Base Link] ) + LEN ( "&page=5802&filter='Value Entry'.'Item Ledger Entry Type' IS 'Sale'" ) + + LEN ( " AND 'Value Entry'.'Document Type' IS ''" ) + + SUMX ( SalesValueEntryDocTypesWithValues, LEN ( [DocTypeValue] ) + 1 ) + + LEN ( " AND 'Value Entry'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Value Entries'[Document No.] ), LEN ( 'Sales Value Entries'[Document No.] ) + 1 ) + + LEN ( " AND 'Value Entry'.'Posting Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Value Entry'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Value Entry'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Value Entries'[itemNo] ), LEN ( 'Sales Value Entries'[itemNo] ) + 1 ), + "Sales Invoice Line", + LEN ( [Base Link] ) + LEN ( "&page=526&filter='Sales Invoice Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Invoice Lines'[Document No.] ), LEN ( 'Sales Invoice Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Sales Invoice Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Sales Invoice Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Invoice Lines'[No] ), LEN ( 'Sales Invoice Lines'[No] ) + 1 ) + + LEN ( " AND 'Sales Invoice Line'.'Type' IS ''" ) + + SUMX ( SalesInvoiceLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ), + "Sales Credit Line", + LEN ( [Base Link] ) + LEN ( "&page=527&filter='Sales Cr.Memo Line'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Credit Lines'[Document No.] ), LEN ( 'Sales Credit Lines'[Document No.] ) + 1 ) + + LEN ( " AND 'Sales Cr.Memo Line'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Sales Cr.Memo Line'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Credit Lines'[No] ), LEN ( 'Sales Credit Lines'[No] ) + 1 ) + + LEN ( " AND 'Sales Cr.Memo Line'.'Type' IS ''" ) + + SUMX ( SalesCreditLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ), + "Project Ledger Entry", + LEN ( [Base Link] ) + LEN ( "&page=92&filter='Job Ledger Entry'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entries'[Document No.] ), LEN ( 'Project Ledger Entries'[Document No.] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Job No.' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entries'[projectNo] ), LEN ( 'Project Ledger Entries'[projectNo] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Job Ledger Entry'.'No.' IS ''" ) + + SUMX ( VALUES ( 'Project Ledger Entries'[No] ), LEN ( 'Project Ledger Entries'[No] ) + 1 ) + + LEN ( " AND 'Job Ledger Entry'.'Type' IS ''" ) + + SUMX ( SalesLineTypesWithValues, LEN ( [LineTypeValue] ) + 1 ) + ) - RETURN + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, SWITCH( SELECTEDVALUE('Documents'[Source Table]), "Sales Line", + VAR SalesLineDocumentTypes = CONCATENATEX ( SalesLineDocTypesWithValues, [DocTypeValue], "|" ) + VAR SalesLineDocumentNos = CONCATENATEX ( VALUES ( 'Sales Lines'[Document No.] ), 'Sales Lines'[Document No.], "|" ) + VAR SalesLineItems = CONCATENATEX ( VALUES ( 'Sales Lines'[itemNo] ), 'Sales Lines'[itemNo], "|" ) + VAR SalesLineTypes = CONCATENATEX ( SalesLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=516&filter='Sales Line'.'Document Type' IS '" & SalesLineDocumentTypes & "'" & " AND 'Sales Line'.'Document No.' IS '" & SalesLineDocumentNos & "'" @@ -235,6 +289,10 @@ table Documents & " AND 'Sales Line'.'No.' IS '" & SalesLineItems & "'" & " AND 'Sales Line'.'Type' IS '" & SalesLineTypes & "'", "Sales Value Entries", + VAR SalesValueEntryDocumentTypes = CONCATENATEX ( SalesValueEntryDocTypesWithValues, [DocTypeValue], "|" ) + VAR SalesValueEntriesDocumentNos = CONCATENATEX ( VALUES ( 'Sales Value Entries'[Document No.] ), 'Sales Value Entries'[Document No.], "|" ) + VAR SalesValueEntriesItems = CONCATENATEX ( VALUES ( 'Sales Value Entries'[itemNo] ), 'Sales Value Entries'[itemNo], "|" ) + RETURN [Base Link] & "&page=5802&filter='Value Entry'.'Item Ledger Entry Type' IS 'Sale'" & " AND 'Value Entry'.'Document Type' IS '" & SalesValueEntryDocumentTypes & "'" & " AND 'Value Entry'.'Document No.' IS '" & SalesValueEntriesDocumentNos & "'" @@ -242,24 +300,39 @@ table Documents & " AND 'Value Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Value Entry'.'Item No.' IS '" & SalesValueEntriesItems & "'", "Sales Invoice Line", + VAR SalesInvoiceLineDocumentNos = CONCATENATEX ( VALUES ( 'Sales Invoice Lines'[Document No.] ), 'Sales Invoice Lines'[Document No.], "|" ) + VAR SalesInvoiceLineItems = CONCATENATEX ( VALUES ( 'Sales Invoice Lines'[No] ), 'Sales Invoice Lines'[No], "|" ) + VAR SalesInvoiceLineTypes = CONCATENATEX ( SalesInvoiceLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=526&filter='Sales Invoice Line'.'Document No.' IS '" & SalesInvoiceLineDocumentNos & "'" & " AND 'Sales Invoice Line'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Sales Invoice Line'.'No.' IS '" & SalesInvoiceLineItems & "'" & " AND 'Sales Invoice Line'.'Type' IS '" & SalesInvoiceLinetypes & "'", "Sales Credit Line", + VAR SalesCreditLineDocumentNos = CONCATENATEX ( VALUES ( 'Sales Credit Lines'[Document No.] ), 'Sales Credit Lines'[Document No.], "|" ) + VAR SalesCreditLineItems = CONCATENATEX ( VALUES ( 'Sales Credit Lines'[No] ), 'Sales Credit Lines'[No], "|" ) + VAR SalesCreditLineTypes = CONCATENATEX ( SalesCreditLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=527&filter='Sales Cr.Memo Line'.'Document No.' IS '" & SalesCreditLineDocumentNos & "'" & " AND 'Sales Cr.Memo Line'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Sales Cr.Memo Line'.'No.' IS '" & SalesCreditLineItems & "'" & " AND 'Sales Cr.Memo Line'.'Type' IS '" & SalesCreditLineTypes & "'", "Project Ledger Entry", + VAR ProjectLedgerEntryDocumentNos = CONCATENATEX ( VALUES ( 'Project Ledger Entries'[Document No.] ), 'Project Ledger Entries'[Document No.], "|" ) + VAR ProjectLedgerEntryProjectNos = CONCATENATEX ( VALUES ( 'Project Ledger Entries'[projectNo] ), 'Project Ledger Entries'[projectNo], "|" ) + VAR ProjectLedgerEntryItems = CONCATENATEX ( VALUES ( 'Project Ledger Entries'[No] ), 'Project Ledger Entries'[No], "|" ) + VAR ProjectLedgerEntryTypes = CONCATENATEX ( SalesLineTypesWithValues, [LineTypeValue], "|" ) + RETURN [Base Link] & "&page=92&filter='Job Ledger Entry'.'Document No.' IS '" & ProjectLedgerEntryDocumentNos & "'" & " AND 'Job Ledger Entry'.'Job No.' IS '" & ProjectLedgerEntryProjectNos & "'" & " AND 'Job Ledger Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" & " AND 'Job Ledger Entry'.'No.' IS '" & ProjectLedgerEntryItems & "'" & " AND 'Job Ledger Entry'.'Type' IS '" & ProjectLedgerEntryTypes & "'" + ), + _PageOnly ) ``` displayFolder: _Sales Measures\_Back Links @@ -402,75 +475,36 @@ table Documents measure 'Ranged Dimensions' = ``` - VAR _FilterTable = VALUES('Dimension Sets'[dimensionSetID]) - VAR IndexedDimSetID = - ADDCOLUMNS( - _FilterTable, - "@Index", RANKX( - SUMMARIZECOLUMNS( - 'Dimension Sets'[dimensionSetID], _FilterTable - ), - 'Dimension Sets'[dimensionSetID], - , - ASC, - DENSE - ) + VAR NormalizedIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) ) - - VAR PreviousIndexedDimSetID = - ADDCOLUMNS( - IndexedDimSetID, - "@Previous Date", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = PrevIndex), - [dimensionSetID]) - ) - - VAR CalculateBreakPoint = - ADDCOLUMNS( - PreviousIndexedDimSetID, - "@Break Point", - IF( NOT 'Dimension Sets'[dimensionSetID] - [@Previous Date] = 1, TRUE(), FALSE() - ) + VAR DistinctIDs = DISTINCT(NormalizedIDs) + VAR MaxID = MAXX(DistinctIDs, [DimensionSetID]) + VAR RangeStarts = + FILTER( + DistinctIDs, + VAR CurrentID = [DimensionSetID] + RETURN COUNTROWS(FILTER(DistinctIDs, [DimensionSetID] = CurrentID - 1)) = 0 ) - - VAR BreakPointTable = FILTER(CalculateBreakPoint, [@Break Point] = TRUE()) - - VAR MaxDimension = CALCULATE(MAX('Dimension Sets'[dimensionSetID]),_FilterTable) - - var NextIndex = + VAR RangeEnds = ADDCOLUMNS( - BreakPointTable, - "@NextIndex", - SELECTCOLUMNS( - OFFSET( +1, BreakPointTable ), - [@Index] - ) - 1 + RangeStarts, + "@RangeEnd", + VAR CurrentStart = [DimensionSetID] + VAR NextStart = MINX(FILTER(RangeStarts, [DimensionSetID] > CurrentStart), [DimensionSetID]) + RETURN IF(ISBLANK(NextStart), MaxID, MAXX(FILTER(DistinctIDs, [DimensionSetID] < NextStart), [DimensionSetID])) ) - - VAR NextDimension = + VAR Ranges = ADDCOLUMNS( - NextIndex, - "@NextDimension", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = [@NextIndex]), - 'Dimension Sets'[dimensionSetID]) - ) - - VAR Ranged = - ADDCOLUMNS( - NextDimension, - "@Range", - IF( ISBLANK([@NextDimension]), - 'Dimension Sets'[dimensionSetID] & ".." & MaxDimension , - 'Dimension Sets'[dimensionSetID] & ".." & [@NextDimension] + RangeEnds, + "@Range", + IF([DimensionSetID] = [@RangeEnd], [DimensionSetID] & "", [DimensionSetID] & ".." & [@RangeEnd]) ) - ) Return - IF(COUNTROWS(NextDimension) = 1, MaxDimension, CONCATENATEX(Ranged, [@Range], "|")) + CONCATENATEX(Ranges, [@Range], "|", [DimensionSetID], ASC) ``` displayFolder: _Sales Measures\_Back Links lineageTag: 08d97b1c-8c55-423e-b9cf-8a3328c70938 @@ -527,4 +561,3 @@ table Documents annotation PBI_NavigationStepName = Navigation annotation PBI_ResultType = Table - diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Opportunity Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Opportunity Entries.tmdl index 7be150cf35..88275d7f55 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Opportunity Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Opportunity Entries.tmdl @@ -64,10 +64,24 @@ table 'Opportunity Entries' VAR OpportunityNos = CONCATENATEX(VALUES('Opportunity Entries'[Opportunity No.]), 'Opportunity Entries'[Opportunity No.], "|") VAR EntryNos = CONCATENATEX(VALUES('Opportunity Entries'[Opportunity Entry No.]), 'Opportunity Entries'[Opportunity Entry No.], "|") - RETURN + VAR PageLink = [Base Link] - & "&page=5130&filter='Opportunity Entry'.'Opportunity No.' IS '" & OpportunityNos & "'" - & " AND 'Opportunity Entry'.'Entry No.' IS '" & EntryNos & "'" + & "&page=5130" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Opportunity Entry'.'Opportunity No.' IS ''" ) + + SUMX ( VALUES ( 'Opportunity Entries'[Opportunity No.] ), LEN ( 'Opportunity Entries'[Opportunity No.] ) + 1 ) + + LEN ( " AND 'Opportunity Entry'.'Entry No.' IS ''" ) + + SUMX ( VALUES ( 'Opportunity Entries'[Opportunity Entry No.] ), LEN ( 'Opportunity Entries'[Opportunity Entry No.] ) + 1 ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PageLink & "&filter='Opportunity Entry'.'Opportunity No.' IS '" & CONCATENATEX(VALUES('Opportunity Entries'[Opportunity No.]), 'Opportunity Entries'[Opportunity No.], "|") & "'" + & " AND 'Opportunity Entry'.'Entry No.' IS '" & CONCATENATEX(VALUES('Opportunity Entries'[Opportunity Entry No.]), 'Opportunity Entries'[Opportunity Entry No.], "|") & "'", + PageLink + ) ``` displayFolder: _Opportunity Entry Measures diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Sales Budget.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Sales Budget.tmdl index 05c5c6bfb3..ebaa86c46a 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Sales Budget.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Sales Budget.tmdl @@ -53,12 +53,30 @@ table 'Sales Budget' VAR BudgetNames = CONCATENATEX(VALUES('Sales Budget'[Budget Name]), 'Sales Budget'[Budget Name], "|") VAR Items = CONCATENATEX(VALUES('Sales Budget'[Item No.]), 'Sales Budget'[Item No.], "|") - RETURN + VAR PageLink = [Base Link] - & "&page=7133&filter='Item Budget Entry'.'Budget Name' IS '" & BudgetNames & "'" - & " AND 'Item Budget Entry'.'Entry No.' IS '" & EntryNos & "'" - & " AND 'Item Budget Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" - & " AND 'Item Budget Entry'.'Item No.' IS '" & Items & "'" + & "&page=7133" + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Item Budget Entry'.'Budget Name' IS ''" ) + + SUMX ( VALUES ( 'Sales Budget'[Budget Name] ), LEN ( 'Sales Budget'[Budget Name] ) + 1 ) + + LEN ( " AND 'Item Budget Entry'.'Entry No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Budget'[Entry No.] ), LEN ( 'Sales Budget'[Entry No.] ) + 1 ) + + LEN ( " AND 'Item Budget Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Sales Budget'[Dimension Set ID] ), LEN ( 'Sales Budget'[Dimension Set ID] ) + 1 ) + + LEN ( " AND 'Item Budget Entry'.'Item No.' IS ''" ) + + SUMX ( VALUES ( 'Sales Budget'[Item No.] ), LEN ( 'Sales Budget'[Item No.] ) + 1 ) + RETURN + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + PageLink & "&filter='Item Budget Entry'.'Budget Name' IS '" & CONCATENATEX(VALUES('Sales Budget'[Budget Name]), 'Sales Budget'[Budget Name], "|") & "'" + & " AND 'Item Budget Entry'.'Entry No.' IS '" & CONCATENATEX(VALUES('Sales Budget'[Entry No.]), 'Sales Budget'[Entry No.], "|") & "'" + & " AND 'Item Budget Entry'.'Dimension Set ID' IS '" & CONCATENATEX(VALUES('Sales Budget'[Dimension Set ID]), 'Sales Budget'[Dimension Set ID], "|") & "'" + & " AND 'Item Budget Entry'.'Item No.' IS '" & CONCATENATEX(VALUES('Sales Budget'[Item No.]), 'Sales Budget'[Item No.], "|") & "'", + PageLink + ) ``` displayFolder: _Budget Measures lineageTag: fcc56428-0d62-4094-b438-55789e98a695 diff --git a/src/Apps/W1/Subscription Billing/App/.resources/Subscription Billing app.pbix b/src/Apps/W1/Subscription Billing/App/.resources/Subscription Billing app.pbix index 0f924209d2..b4d35dfc40 100644 Binary files a/src/Apps/W1/Subscription Billing/App/.resources/Subscription Billing app.pbix and b/src/Apps/W1/Subscription Billing/App/.resources/Subscription Billing app.pbix differ diff --git a/src/Apps/W1/Subscription Billing/Power BI Files/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl b/src/Apps/W1/Subscription Billing/Power BI Files/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl index ac1de0650d..18d60b6be4 100644 --- a/src/Apps/W1/Subscription Billing/Power BI Files/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl +++ b/src/Apps/W1/Subscription Billing/Power BI Files/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl @@ -754,75 +754,36 @@ table 'Subscription Billing KPIs' measure 'Ranged Dimensions' = ``` - VAR _FilterTable = VALUES('Dimension Sets'[dimensionSetID]) - VAR IndexedDimSetID = - ADDCOLUMNS( - _FilterTable, - "@Index", RANKX( - SUMMARIZECOLUMNS( - 'Dimension Sets'[dimensionSetID], _FilterTable - ), - 'Dimension Sets'[dimensionSetID], - , - ASC, - DENSE - ) + VAR NormalizedIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) ) - - VAR PreviousIndexedDimSetID = - ADDCOLUMNS( - IndexedDimSetID, - "@Previous Date", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = PrevIndex), - [dimensionSetID]) + VAR DistinctIDs = DISTINCT(NormalizedIDs) + VAR MaxID = MAXX(DistinctIDs, [DimensionSetID]) + VAR RangeStarts = + FILTER( + DistinctIDs, + VAR CurrentID = [DimensionSetID] + RETURN COUNTROWS(FILTER(DistinctIDs, [DimensionSetID] = CurrentID - 1)) = 0 ) - - VAR CalculateBreakPoint = + VAR RangeEnds = ADDCOLUMNS( - PreviousIndexedDimSetID, - "@Break Point", - IF( NOT 'Dimension Sets'[dimensionSetID] - [@Previous Date] = 1, TRUE(), FALSE() - ) + RangeStarts, + "@RangeEnd", + VAR CurrentStart = [DimensionSetID] + VAR NextStart = MINX(FILTER(RangeStarts, [DimensionSetID] > CurrentStart), [DimensionSetID]) + RETURN IF(ISBLANK(NextStart), MaxID, MAXX(FILTER(DistinctIDs, [DimensionSetID] < NextStart), [DimensionSetID])) ) - - VAR BreakPointTable = FILTER(CalculateBreakPoint, [@Break Point] = TRUE()) - - VAR MaxDimension = CALCULATE(MAX('Dimension Sets'[dimensionSetID]),_FilterTable) - - var NextIndex = + VAR Ranges = ADDCOLUMNS( - BreakPointTable, - "@NextIndex", - SELECTCOLUMNS( - OFFSET( +1, BreakPointTable ), - [@Index] - ) - 1 + RangeEnds, + "@Range", + IF([DimensionSetID] = [@RangeEnd], [DimensionSetID] & "", [DimensionSetID] & ".." & [@RangeEnd]) ) - - VAR NextDimension = - ADDCOLUMNS( - NextIndex, - "@NextDimension", - VAR PrevIndex = [@Index] - 1 - RETURN SELECTCOLUMNS( - FILTER(IndexedDimSetID, [@Index] = [@NextIndex]), - 'Dimension Sets'[dimensionSetID]) - ) - - VAR Ranged = - ADDCOLUMNS( - NextDimension, - "@Range", - IF( ISBLANK([@NextDimension]), - 'Dimension Sets'[dimensionSetID] & ".." & MaxDimension , - 'Dimension Sets'[dimensionSetID] & ".." & [@NextDimension] - ) - ) Return - IF(COUNTROWS(NextDimension) = 1, MaxDimension, CONCATENATEX(Ranged, [@Range], "|")) + CONCATENATEX(Ranges, [@Range], "|", [DimensionSetID], ASC) ``` isHidden displayFolder: Back Links @@ -832,77 +793,238 @@ table 'Subscription Billing KPIs' measure 'Customer Deferrals Back Link' = ``` - VAR CustomerContractDeferralDocumentNos = - CONCATENATEX(VALUES('Customer Contract Deferrals'[Document No.]), 'Customer Contract Deferrals'[Document No.], "|") - VAR CustomerContractDeferralSubscriptionNos = - CONCATENATEX(VALUES('Customer Contract Deferrals'[Contract No.]), 'Customer Contract Deferrals'[Contract No.], "|") - VAR CustomerContractDeferralReleasedStatus = - CONCATENATEX(VALUES('Is Released'[Is Released Value]), 'Is Released'[Is Released Value], "|") + VAR PageLink = [Base Link] & "&page=8079" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each run by (2 * widest selected dimension set ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Cust. Sub. Contract Deferral'.'Subscription Contract No.' IS ''" ) + + SUMX ( VALUES ( 'Customer Contract Deferrals'[Contract No.] ), LEN ( 'Customer Contract Deferrals'[Contract No.] ) + 1 ) + + LEN ( " AND 'Cust. Sub. Contract Deferral'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Customer Contract Deferrals'[Document No.] ), LEN ( 'Customer Contract Deferrals'[Document No.] ) + 1 ) + + LEN ( " AND 'Cust. Sub. Contract Deferral'.'Posting Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Cust. Sub. Contract Deferral'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Cust. Sub. Contract Deferral'.'Released' IS ''" ) + + SUMX ( VALUES ( 'Is Released'[Is Released Value] ), LEN ( 'Is Released'[Is Released Value] ) + 1 ) RETURN - [Base Link] - & "&page=8079&filter='Cust. Sub. Contract Deferral'.'Subscription Contract No.' IS '" & CustomerContractDeferralSubscriptionNos & "'" - & " AND 'Cust. Sub. Contract Deferral'.'Document No.' IS '" & CustomerContractDeferralDocumentNos & "'" - & " AND 'Cust. Sub. Contract Deferral'.'Posting Date' IS " & [Ranged] - & " AND 'Cust. Sub. Contract Deferral'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" - & " AND 'Cust. Sub. Contract Deferral'.'Released' IS '" & CustomerContractDeferralReleasedStatus & "'" + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR CustomerContractDeferralDocumentNos = + CONCATENATEX(VALUES('Customer Contract Deferrals'[Document No.]), 'Customer Contract Deferrals'[Document No.], "|") + VAR CustomerContractDeferralSubscriptionNos = + CONCATENATEX(VALUES('Customer Contract Deferrals'[Contract No.]), 'Customer Contract Deferrals'[Contract No.], "|") + VAR CustomerContractDeferralReleasedStatus = + CONCATENATEX(VALUES('Is Released'[Is Released Value]), 'Is Released'[Is Released Value], "|") + RETURN + PageLink + & "&filter='Cust. Sub. Contract Deferral'.'Subscription Contract No.' IS '" & CustomerContractDeferralSubscriptionNos & "'" + & " AND 'Cust. Sub. Contract Deferral'.'Document No.' IS '" & CustomerContractDeferralDocumentNos & "'" + & " AND 'Cust. Sub. Contract Deferral'.'Posting Date' IS " & [Ranged] + & " AND 'Cust. Sub. Contract Deferral'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" + & " AND 'Cust. Sub. Contract Deferral'.'Released' IS '" & CustomerContractDeferralReleasedStatus & "'", + PageLink + ) ``` displayFolder: Back Links lineageTag: b0e9cd9b-c824-482b-93b8-946fe797d20c measure 'Vendor Deferrals Back Link' = ``` - VAR VendorContractDeferralDocumentNos = - CONCATENATEX(VALUES('Vendor Contract Deferrals'[Document No.]), 'Vendor Contract Deferrals'[Document No.], "|") - VAR VendorContractDeferralSubscriptionNos = - CONCATENATEX(VALUES('Vendor Contract Deferrals'[Contract No.]), 'Vendor Contract Deferrals'[Contract No.], "|") - VAR VendorContractDeferralReleasedStatus = - CONCATENATEX(VALUES('Is Released'[Is Released Value]), 'Is Released'[Is Released Value], "|") - + VAR PageLink = [Base Link] & "&page=8081" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each run by (2 * widest selected dimension set ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Vend. Sub. Contract Deferral'.'Subscription Contract No.' IS ''" ) + + SUMX ( VALUES ( 'Vendor Contract Deferrals'[Contract No.] ), LEN ( 'Vendor Contract Deferrals'[Contract No.] ) + 1 ) + + LEN ( " AND 'Vend. Sub. Contract Deferral'.'Document No.' IS ''" ) + + SUMX ( VALUES ( 'Vendor Contract Deferrals'[Document No.] ), LEN ( 'Vendor Contract Deferrals'[Document No.] ) + 1 ) + + LEN ( " AND 'Vend. Sub. Contract Deferral'.'Posting Date' IS " ) + ProjectedRangedLength + + LEN ( " AND 'Vend. Sub. Contract Deferral'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Vend. Sub. Contract Deferral'.'Released' IS ''" ) + + SUMX ( VALUES ( 'Is Released'[Is Released Value] ), LEN ( 'Is Released'[Is Released Value] ) + 1 ) RETURN - [Base Link] - & "&page=8081&filter='Vend. Sub. Contract Deferral'.'Subscription Contract No.' IS '" & VendorContractDeferralSubscriptionNos & "'" - & " AND 'Vend. Sub. Contract Deferral'.'Document No.' IS '" & VendorContractDeferralDocumentNos & "'" - & " AND 'Vend. Sub. Contract Deferral'.'Posting Date' IS " & [Ranged] - & " AND 'Vend. Sub. Contract Deferral'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" - & " AND 'Vend. Sub. Contract Deferral'.'Released' IS '" & VendorContractDeferralReleasedStatus & "'" + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR VendorContractDeferralDocumentNos = + CONCATENATEX(VALUES('Vendor Contract Deferrals'[Document No.]), 'Vendor Contract Deferrals'[Document No.], "|") + VAR VendorContractDeferralSubscriptionNos = + CONCATENATEX(VALUES('Vendor Contract Deferrals'[Contract No.]), 'Vendor Contract Deferrals'[Contract No.], "|") + VAR VendorContractDeferralReleasedStatus = + CONCATENATEX(VALUES('Is Released'[Is Released Value]), 'Is Released'[Is Released Value], "|") + RETURN + PageLink + & "&filter='Vend. Sub. Contract Deferral'.'Subscription Contract No.' IS '" & VendorContractDeferralSubscriptionNos & "'" + & " AND 'Vend. Sub. Contract Deferral'.'Document No.' IS '" & VendorContractDeferralDocumentNos & "'" + & " AND 'Vend. Sub. Contract Deferral'.'Posting Date' IS " & [Ranged] + & " AND 'Vend. Sub. Contract Deferral'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" + & " AND 'Vend. Sub. Contract Deferral'.'Released' IS '" & VendorContractDeferralReleasedStatus & "'", + PageLink + ) ``` displayFolder: Back Links lineageTag: fb40ded3-6eb4-4595-a359-ef320241ce65 measure 'Customer Contract Line Back Link' = ``` - VAR ContractLineCustContNos = - CONCATENATEX(VALUES('Customer Contract Line'[Customer Contract No.]), 'Customer Contract Line'[Customer Contract No.], "|") - VAR ContractLineCustContLineNos = - CONCATENATEX(VALUES('Customer Contract Line'[Customer Contract Line No.]), 'Customer Contract Line'[Customer Contract Line No.], "|") - + VAR PageLink = [Base Link] & "&page=8090" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each run by (2 * widest selected dimension set ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Sub. Contr. Analysis Entry'.'Partner' IS 'Customer'" ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS ''" ) + + SUMX ( VALUES ( 'Customer Contract Line'[Customer Contract No.] ), LEN ( 'Customer Contract Line'[Customer Contract No.] ) + 1 ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS ''" ) + + SUMX ( VALUES ( 'Customer Contract Line'[Customer Contract Line No.] ), LEN ( 'Customer Contract Line'[Customer Contract Line No.] ) + 1 ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS ''" ) + ProjectedRangedLength RETURN - [Base Link] - & "&page=8090&filter='Sub. Contr. Analysis Entry'.'Partner' IS '" & "Customer" & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS '" & ContractLineCustContNos & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS '" & ContractLineCustContLineNos & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS '" & [Ranged] & "'" - + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR ContractLineCustContNos = + CONCATENATEX(VALUES('Customer Contract Line'[Customer Contract No.]), 'Customer Contract Line'[Customer Contract No.], "|") + VAR ContractLineCustContLineNos = + CONCATENATEX(VALUES('Customer Contract Line'[Customer Contract Line No.]), 'Customer Contract Line'[Customer Contract Line No.], "|") + RETURN + PageLink + & "&filter='Sub. Contr. Analysis Entry'.'Partner' IS '" & "Customer" & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS '" & ContractLineCustContNos & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS '" & ContractLineCustContLineNos & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS '" & [Ranged] & "'", + PageLink + ) ``` displayFolder: Back Links lineageTag: fe25274f-9ebf-477c-97a4-790b677123a4 measure 'Vendor Contract Line Back Link' = ``` - VAR ContractLineVendContNos = - CONCATENATEX(VALUES('Vendor Contract Line'[Vendor Contract No.]), 'Vendor Contract Line'[Vendor Contract No.], "|") - VAR ContractLineVendContLineNos = - CONCATENATEX(VALUES('Vendor Contract Line'[Vendor Contract Line No.]), 'Vendor Contract Line'[Vendor Contract Line No.], "|") - + VAR PageLink = [Base Link] & "&page=8090" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 + ) + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + VAR NormalizedDimensionSetIDs = + SELECTCOLUMNS( + VALUES('Dimension Sets'[dimensionSetID]), + "DimensionSetID", IF(ISBLANK('Dimension Sets'[dimensionSetID]), 0, 'Dimension Sets'[dimensionSetID]) + ) + VAR DistinctDimensionSetIDs = DISTINCT ( NormalizedDimensionSetIDs ) + VAR MaximumDimensionSetIDDigits = LEN ( MAXX ( DistinctDimensionSetIDs, [DimensionSetID] ) & "" ) + VAR DimensionRangeStarts = + FILTER ( + DistinctDimensionSetIDs, + VAR CurrentDimensionSetID = [DimensionSetID] + RETURN COUNTROWS ( FILTER ( DistinctDimensionSetIDs, [DimensionSetID] = CurrentDimensionSetID - 1 ) ) = 0 + ) + // Conservative estimate: bound each run by (2 * widest selected dimension set ID + separator/range marker) + VAR ProjectedRangedDimensionsLength = COUNTROWS ( DimensionRangeStarts ) * ( 2 * MaximumDimensionSetIDDigits + 3 ) + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( PageLink ) + + LEN ( "&filter='Sub. Contr. Analysis Entry'.'Partner' IS 'Vendor'" ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS ''" ) + + SUMX ( VALUES ( 'Vendor Contract Line'[Vendor Contract No.] ), LEN ( 'Vendor Contract Line'[Vendor Contract No.] ) + 1 ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS ''" ) + + SUMX ( VALUES ( 'Vendor Contract Line'[Vendor Contract Line No.] ), LEN ( 'Vendor Contract Line'[Vendor Contract Line No.] ) + 1 ) + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS ''" ) + ProjectedRangedDimensionsLength + + LEN ( " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS ''" ) + ProjectedRangedLength RETURN - [Base Link] - & "&page=8090&filter='Sub. Contr. Analysis Entry'.'Partner' IS '" & "Vendor" & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS '" & ContractLineVendContNos & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS '" & ContractLineVendContLineNos & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" - & " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS '" & [Ranged] & "'" - + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR ContractLineVendContNos = + CONCATENATEX(VALUES('Vendor Contract Line'[Vendor Contract No.]), 'Vendor Contract Line'[Vendor Contract No.], "|") + VAR ContractLineVendContLineNos = + CONCATENATEX(VALUES('Vendor Contract Line'[Vendor Contract Line No.]), 'Vendor Contract Line'[Vendor Contract Line No.], "|") + RETURN + PageLink + & "&filter='Sub. Contr. Analysis Entry'.'Partner' IS '" & "Vendor" & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract No.' IS '" & ContractLineVendContNos & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Subscription Contract Line No.' IS '" & ContractLineVendContLineNos & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Dimension Set ID' IS '" & [Ranged Dimensions] & "'" + & " AND 'Sub. Contr. Analysis Entry'.'Analysis Date' IS '" & [Ranged] & "'", + PageLink + ) ``` displayFolder: Back Links lineageTag: 39f6703a-1ae0-4b23-b3e6-88e885731623 diff --git a/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Employee Ledger Entries.tmdl b/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Employee Ledger Entries.tmdl index d67279528e..8351377cb3 100644 --- a/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Employee Ledger Entries.tmdl +++ b/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Employee Ledger Entries.tmdl @@ -13,23 +13,46 @@ table 'Employee Ledger Entries' VAR Endpoint = "&page=5237&" VAR BaseLink = [Base Link] & Endpoint // Filter Context - VAR EmployeeNo = - CONCATENATEX ( - VALUES ( 'Employee Ledger Entries'[Employee No.] ), - 'Employee Ledger Entries'[Employee No.], - "|" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 ) - VAR DimensionSetIDs = - CONCATENATEX ( - VALUES ( 'Employee Ledger Entries'[Dimension Set ID] ), - 'Employee Ledger Entries'[Dimension Set ID], - "|" - ) - VAR EmployeeNoFilter = "filter='Employee Ledger Entry'.'Employee No.' IS '" & EmployeeNo & "'" - VAR DateFilter = " AND 'Employee Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Employee Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Employee Ledger Entry'.'Employee No.' IS ''" ) + + SUMX ( VALUES ( 'Employee Ledger Entries'[Employee No.] ), LEN ( 'Employee Ledger Entries'[Employee No.] ) + 1 ) + + LEN ( " AND 'Employee Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Employee Ledger Entries'[Dimension Set ID] ), LEN ( 'Employee Ledger Entries'[Dimension Set ID] ) + 1 ) + + LEN ( " AND 'Employee Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & EmployeeNoFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR EmployeeNo = + CONCATENATEX ( + VALUES ( 'Employee Ledger Entries'[Employee No.] ), + 'Employee Ledger Entries'[Employee No.], + "|" + ) + VAR DimensionSetIDs = + CONCATENATEX ( + VALUES ( 'Employee Ledger Entries'[Dimension Set ID] ), + 'Employee Ledger Entries'[Dimension Set ID], + "|" + ) + VAR EmployeeNoFilter = "filter='Employee Ledger Entry'.'Employee No.' IS '" & EmployeeNo & "'" + VAR DateFilter = " AND 'Employee Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" + VAR DimensionFilter = " AND 'Employee Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + RETURN + BaseLink & EmployeeNoFilter & DimensionFilter & DateFilter, + BaseLink + ) displayFolder: _Back Link lineageTag: 702abf4b-9e8a-40cd-b20d-080b777d0343 diff --git a/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl b/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl index d41b54e7a4..a75f4c1a08 100644 --- a/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl +++ b/src/Apps/W1/Sustainability/Power BI Files/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl @@ -573,23 +573,46 @@ table 'Sustainability Ledger Entries' VAR Endpoint = "&page=6220&" VAR BaseLink = [Base Link] & Endpoint // Filter Context - VAR AccountNo = - CONCATENATEX ( - VALUES ( 'Sustainability Ledger Entries'[Sustainability Account No.] ), - 'Sustainability Ledger Entries'[Sustainability Account No.], - "|" + VAR SelectedDates = VALUES ( 'Date'[Date] ) + VAR DateRangeStarts = + FILTER ( + SelectedDates, + VAR CurrentDate = 'Date'[Date] + RETURN COUNTROWS ( FILTER ( SelectedDates, 'Date'[Date] = CurrentDate - 1 ) ) = 0 ) - VAR DimensionSetIDs = - CONCATENATEX ( - VALUES ( 'Sustainability Ledger Entries'[Dimension Set ID] ), - 'Sustainability Ledger Entries'[Dimension Set ID], - "|" - ) - VAR AccountNoFilter = "filter='Sustainability Ledger Entry'.'Account No.' IS '" & AccountNo & "'" - VAR DateFilter = " AND 'Sustainability Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" - VAR DimensionFilter = " AND 'Sustainability Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + // Conservative estimate: 23 chars ("yyyy-mm-dd..yyyy-mm-dd" + separator) per consecutive date run + VAR ProjectedRangedLength = COUNTROWS ( DateRangeStarts ) * 23 + // Project the URL length from the raw filter values without building the (possibly huge) URL string + VAR ProjectedLength = + LEN ( BaseLink ) + + LEN ( "filter='Sustainability Ledger Entry'.'Account No.' IS ''" ) + + SUMX ( VALUES ( 'Sustainability Ledger Entries'[Sustainability Account No.] ), LEN ( 'Sustainability Ledger Entries'[Sustainability Account No.] ) + 1 ) + + LEN ( " AND 'Sustainability Ledger Entry'.'Dimension Set ID' IS ''" ) + + SUMX ( VALUES ( 'Sustainability Ledger Entries'[Dimension Set ID] ), LEN ( 'Sustainability Ledger Entries'[Dimension Set ID] ) + 1 ) + + LEN ( " AND 'Sustainability Ledger Entry'.'Posting Date' IS ''" ) + ProjectedRangedLength RETURN - BaseLink & AccountNoFilter & DimensionFilter & DateFilter + // Fall back to the unfiltered page if the URL exceeds the 2000 character limit + IF ( + ProjectedLength <= 2000, + VAR AccountNo = + CONCATENATEX ( + VALUES ( 'Sustainability Ledger Entries'[Sustainability Account No.] ), + 'Sustainability Ledger Entries'[Sustainability Account No.], + "|" + ) + VAR DimensionSetIDs = + CONCATENATEX ( + VALUES ( 'Sustainability Ledger Entries'[Dimension Set ID] ), + 'Sustainability Ledger Entries'[Dimension Set ID], + "|" + ) + VAR AccountNoFilter = "filter='Sustainability Ledger Entry'.'Account No.' IS '" & AccountNo & "'" + VAR DateFilter = " AND 'Sustainability Ledger Entry'.'Posting Date' IS '" & [Ranged] & "'" + VAR DimensionFilter = " AND 'Sustainability Ledger Entry'.'Dimension Set ID' IS '" & DimensionSetIDs & "'" + RETURN + BaseLink & AccountNoFilter & DimensionFilter & DateFilter, + BaseLink + ) displayFolder: _Back Links lineageTag: f24f87a5-4019-4ed5-ae4b-67285d98d57a diff --git a/src/Apps/W1/Sustainability/app/.resources/Sustainability app.pbix b/src/Apps/W1/Sustainability/app/.resources/Sustainability app.pbix index a729166325..82dee88a42 100644 Binary files a/src/Apps/W1/Sustainability/app/.resources/Sustainability app.pbix and b/src/Apps/W1/Sustainability/app/.resources/Sustainability app.pbix differ