"dax "
163 TopicsErro em Calculate com múltiplas referências de filtros
Há alguma alteração documentada ou uma atualização no mecanismo de otimização do Power BI, a partir de março/26, que possa ter tornado mais rigorosa a validação de filtros com múltiplas referências à mesma tabela dentro de uma função CALCULATE? Tinha medidas antigas que estavam funcionando normalmente, apesar da semântica confusa, e passaram a retornar valores incorretos. Tive que reescrevê-las de uma forma mais explicita e semântica para voltarem a funcionar. Por exemplo: Haskell Medida Antiga = VAR QTDE = CALCULATE( Count(Tabela1[Coluna1]), Filter(Tabela2, [Coluna1] = 1), Tabela1, // ← TABELA INTEIRA COMO FILTRO Tabela1[Coluna2]="Sim", Filter(Tabela2, [Coluna2] = "1"), NOT(ISBLANK(Tabela1[Coluna3])) ) COALESCE(QTDE, 0) Refeita para: SQL Medida Nova = VAR QTDE = CALCULATE( COUNT(Tabela1[Coluna1]), Tabela1[Coluna2] = "Sim", NOT(ISBLANK(Tabela1[Coluna3])), Tabela2[Coluna1] = "1", Tabela2[Coluna2] = "1" ) RETURN COALESCE(QTDE, 0) Gostaria de entender o que mudou neste período para avaliar se precisarei revisar todas as medidas antigas em uso nos vários painéis que possuímos. Obrigado!Solved139Views0likes5CommentsMultiple DAX for WoW, YoY, MoM Advice
I'm trying to find the best way to build a KPI overview for a commodity. I have 3 grades of this commodity with new weekly prices. For each need to be able to show: - Week over week price change - Month over month price change - Year over year price change I finished building the week over week and I have 9 DAX measures: - Current Week price - Last week price - Price change % My list is growing as I get into Month over Month..... Is this really the best method???Solved1.2KViews0likes4CommentsParameter in Power BI report Builder
Hi All - I'm facing an issue where Report Builder connected to a Power BI Semantic Model is returning multiple rows. To resolve this, based on this thread I created DAX from Performance Visualiser. There is no mention of how to insert parameters in the above thread. But using this thread I could find how to do it. But when I follow it, I get the error saying the Parameter X is not defined. I've looked at below solutions, but nothing works Pass a Parameter to DAX Query Report Builder - Stack Overflow Chris Webb's BI Blog: Power BI Report Builder And RSCustomDaxFilter Re: The Query contains the "XXXX" parameter, which... - Microsoft Fabric Community Dynamic Parameters in PBI Report Builder using a p... - Microsoft Fabric Community Solved: Bug: Power BI Report Builder - Parameter Not Decla... - Microsoft Fabric Community All I need is, if I'm using the DAX provided by Performance Analyser in the report builder, what is the syntax for that query to use Parameters. Thanks2.1KViews0likes8CommentsHow to create drill-down matrix hierarchy with pre-aggregated data without double-counting?
I have a pre-aggregated dataset from an agency where each hierarchy level has its own row with pre-calculated values: Category Total = 158,244 Sub-category = 45,000 Brand = 11,804 SKU = 350 The dataset also contains multiple periods (Q1, Q2, Q3, Q4, YTD, MAT) and regions — each combination of Product x Period x Region has its own row. Leaf nodes (SKU level) sum up correctly to parent values. What is the best approach to enable drill-down hierarchy in Power BI matrix with this data structure, without double-counting?Solved4KViews0likes6CommentsDynamically show dimension values from the latest transaction in a group
I have a transaction table of Container movements (to customer and back to warehouse). How to make data architecture to get requirements?: To show in a table visualization latest records (dimension values) of each Container_Id by MovementDateTime? I made a Metric with a sign 1, if it is a latest record and a solution worked well, when a Container_Id was filtered, but got an error of calculation limit, when I wanted to show all Container_Id. Any suggestions? How to filter dynamically (using Date filter) latest movement records of each Container_Id?Solved801Views0likes5CommentsHow to write this IF statement for same date, but different statuses?
Hello, I have the two columns below in the same table. "Cookie Type" is text field and "Baked_Date" is a date value. How can I write the IF statement in DAX for the concept: If the same baked_date for Cookie_type "Chewy" and "Chunky", then "Eat", otherwise "do not eat". I added the "Grape" value to show that there are other values in the dataset that are not relevant. Cookie Type Baked_Date Chewy 03/27 Grape 03/27 Chunky 03/27 Thank you!Solved990Views0likes6CommentsMatrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee
Hi, I am working on a Power BI matrix visual where I need to display Allocation Units per employee and also show correct subtotals at the department level and grand total level. Matrix Structure Rows: DepartmentName EmployeeName Values: Allocation Units (measure) Tables Used Table 1: Activity_Log_Table Contains: DepartmentName EmployeeName Table 2: Resource_Allocation_Table Contains: StaffFullName AllocationUnits There is no direct relationship between these tables, so I am using TREATAS() to map EmployeeName with StaffFullName. Current Measure Allocation Units Measure = CALCULATE( MAX('Resource_Allocation_Table'[AllocationUnits]), TREATAS( VALUES('Activity_Log_Table'[EmployeeName]), 'Resource_Allocation_Table'[StaffFullName] ) ) Problem The measure returns correct values at the EmployeeName level, but: DepartmentName subtotal is incorrect Grand total is incorrect Power BI recalculates totals instead of summing visible rows Expected Behaviour I want the matrix totals to behave like Excel-style aggregation: Show correct allocation units per EmployeeName Show subtotal per DepartmentName as sum of EmployeeName values Show correct grand total as sum of all EmployeeName values Avoid duplicate counting when EmployeeName appears multiple times Sample Data Activity_Log_Table DepartmentName EmployeeName Orion Alex M Orion Nina P Orion Kevin L Nova Daniel R Nova Sophia T Resource_Allocation_Table: StaffFullName AllocationUnits Alex M 40 Nina P 25 Kevin L 15 Daniel R 35 Sophia T 20 Expected Matrix Output DepartmentName EmployeeName Allocation Units Orion Alex M 40 Orion Nina P 25 Orion Kevin L 15 Orion Total 80 Nova Daniel R 35 Nova Sophia T 20 Nova Total 55 Grand Total 135 Currently, subtotals and grand totals are not matching the expected summed values. What is the correct DAX approach to ensure totals aggregate properly when using TREATAS() inside a matrix visual? Thanks, SBCSolved710Views0likes3CommentsCombining three CONCATENATEX Measures with results from two Tables
Hello, I am trying to create a status report that pulls in text updates from two tables (two sharepoint lists). Each Table is realted in a Many to 1 with an Intake Table that contains my projects. Working seperatley I've created three Dax Measures that uses CONCATENATEX to return a bulleted list of updates that meet certain criteria. Because of this, each Measure has a Filter with conditions to the table I am pulling data from. Each Measures works alone, however, when I attempt to combines these measures I find that I am only able to apply context to one table. For example, if I use an ALL statment in a nested calcuation this will clear results from the first measure and if I do not clear results the second measure will not return results. To me, this means the CONCATENATEX is running into a null or blank value which means the one of the Filters is not providing a needed context. For refrence this is my combined measure that will only return results for the second part: Measures use three tables. PMO Project Intake has a one to many realtionship with PMO Status Updates and PMO RAID LOG. PMO RAID Log and PMO Status Updates are not related (would need to be many to many and not sure it would help?) Next these are the two measures that work correctly when added seperatly: CARBULLTEDRAID = "Issues & Decision Points:"& UNICHAR(10) &CALCULATE(CONCATENATEX( FILTER('PMO RAID Log', 'PMO RAID Log'[Risk Type]<>"Risk" && 'PMO RAID Log'[Status]= "Open"&& 'PMO RAID Log'[FieldValuesAsText.ProjectName]=SELECTEDVALUE('PMO Project Intake'[Project Name])), UNICHAR(8226) & " " &('PMO RAID Log'[Description])&"-"&('PMO RAID Log'[Resolution])& UNICHAR(10)& UNICHAR(10) ,) ) CARBULLTEDLIST = "STATUS:"& UNICHAR(10) &CALCULATE(CONCATENATEX( FILTER('PMO Status Updates', 'PMO Status Updates'[CommentType]<>"Next Steps" && 'PMO Status Updates'[IncludeinCurrentReporting?]= True&& 'PMO Status Updates'[FieldValuesAsText.ProjectName]=SELECTEDVALUE('PMO Project Intake'[Project Name])), UNICHAR(8226) & " " &('PMO Status Updates'[Created])&"-"&('PMO Status Updates'[CommentType])&"-"& 'PMO Status Updates'[FieldValuesAsText.StatusText], UNICHAR(10)& UNICHAR(10) ,'PMO Status Updates'[Created],DESC) ) This is the combined value which is not working: Combined Measure = VAR Part1 = [CARBULLTEDRAID] VAR Part2 = CALCULATE( [CARBULLTEDLIST], ALL('PMO Status Updates') ) RETURN Part2 & " | " & Part1 The above only returns the results for measure [CARBUILTED RAID] and not the others: I underestand I could create a new table with all of these statues together in M, however, I am wondering if I am missing something the CONCATENATEX Statment. Is is possible to combine the results of multiple measures that use CONCATENATEX and keep the context for each measure? And if so how can I nest the DAX that restest context without having the rest apply where it isn't allowed? Thank you!Solved2.6KViews0likes14CommentsCalculating Cumulative Inventory with a Conditional "Reset to Zero" if Previous Month is Negative
I am building an Inventory Projection report in Power BI. I need to calculate the Opening Inventory for each month based on a starting balance from February 2026, then adding/subtracting monthly movements (Purchase Orders vs. Forecasts). The core challenge is the reset logic required for planning: Standard Accumulation: If the balance is positive, it should carry over to the next month as the Opening Inventory. Conditional Reset: If the calculated balance for a month is negative (e.g., April ends at -51), I still want to show that negative value for that specific month. The "Planning Start" Rule: However, for the next month's calculation (e.g., May), the calculation should not start from -51. Instead, it should reset to 0 and then apply that month's movements (PO - Forecast). Current Conflict: A standard cumulative DAX measure carries the negative debt forward (e.g., $-51 + (-346) = -397$), which is logically correct for accounting but incorrect for my supply planning needs. Attempts to use MAX(0, ...) often hide the negative values I need to see in the current month or cause "Circular Dependency" errors when trying to reference the measure's own previous value. Data Structure: DateTable: Standard calendar table. Opening Balance: A static value from a history table for the starting month (Feb 2026). Measures: [IN_PO], [Received Qty PO], and [Item Forecast]. Example of Desired Output: Month Calculation Logic Opening Inventory (Result) Feb Starting Balance 428 Mar $428 + 268 - 405$ 86 Apr $86 + 0 - 346$ -51 (Show negative) May Reset to 0 because April was negative -261 (0 + May movements) Question: How can I write a DAX measure that iterates through the months and resets the "Internal Carryover" to zero without losing the visibility of the negative result in the previous month's row?Solved767Views0likes3CommentsDAX standalone query execution using python
Hi, iwanted to execute DAX query through service principal in python standalone (vsCOde). but i got the error as below. Status Code: 401 {"error":{"code":"PowerBINotAuthorizedException","pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}}}Solved1.3KViews0likes5Comments