row
10 TopicsDAX total != total rows
Hi, I have an issue where the total of the rows is not equal to the total calculated in a table, let me explain what I mean: I calculate first the difference between the CA N and CA N-1 that I store in diff_CA measure and I store in Calcul_incremental measure: - if (diff_CA >0, diff_CA, 0) and I except the total to be 129 367,62 +0,00 = 129 637.62 and not 129 367.62 -263.86 = 129 103.76 What am I doing wrong here to fix the total taking into account not the values calculated with the condition ? Thank you in advance Kind regards,Solved1.2KViews2likes6CommentsDax for total row optimization
hi Guys, this is my DAX: EffectivePrice Percentage = IF(ISINSCOPE(Fct_EA_AmortizedCosts[Discountability]) || ISINSCOPE(Fct_EA_AmortizedCosts[DiscountPlanName]) || ISINSCOPE(Fct_EA_AmortizedCosts[SubscriptionName]) || ISINSCOPE(Dim_EA_AmortizedCosts_Resources[ResourceType]), DIVIDE( SUMX( Fct_EA_AmortizedCosts, ('Fct_EA_AmortizedCosts'[EffectivePrice]) * ('Fct_EA_AmortizedCosts'[WeightInBillingCurrency]) ), SUM('Fct_EA_AmortizedCosts'[WeightInBillingCurrency]) ) / 100, BLANK() ) as you can see I am adding ISINSCOPE all the time when new page with new columns in matrix arrived in order to not show total row. Is there a possibility to optimize this DAX to be more generic? Best, JacekSolved857Views0likes3CommentsIs possible to ignore row filter context in a table ?
Hi! I have found various similar issues to this one in the forum but no one of solutions provided works for me 😞 I need for some calculations in a table, the value of the selected value in Group filter. It works OK in a card (as displayed in screenshot attached) , but, when I tried to use it in a table, it change between 2 and 3 (you can see in the table in the screenshot), I understand this is due to the row context filter is being applied to the measure. I need that the value "Selected Group" in my table remains being 3 (the one selected) not depending on row context filter, hoy can I reach that ? I tried with ALL, ALLSELECTED combinations with no success at all Currently my "Selected Group" Measure looks like: Selected Group = VAR currGroup = MAX('Table'[Group Code]) RETURN CALCULATE( MAX('Table'[Group Code]), FILTER ( ALLSELECTED('Table'), 'Table'[Group Code] = currGroup ) ) Thansk in advance!958Views0likes3CommentsUse previous row result as base of calculation
Hello folks ! I hope you are doing well 😁 I'm developping a tool on PBI to calculate a projected stock, i'm really blocked with the formula & DAX command. Basicly i use the month stock of my clients to calculate their needs and i do a simulation with my shipping plan. Here my draft : Basicly to calculate the projected stock i do : Projected Stock = [Stock] + [Inbound M-1] - [2024+%] [Stock] is the declared stock by the client and its blank if we don't have the data [Inbound M-1] is the entering stock to the client warehouse [2024+%] is the sell-out of my client with a % of depletion All the rows are diferents mesures coming from a data base and converted to the same unit. What I want to do is that if my [Stock] = blank(), I use the previous result of the projected stock as [Stock] to simulate the new projected stock for the next month and do it recursively. I hope you'll understand my problem and try to help me. The column "Test2" its my tentative and its working for march but not for the other months, here my code : Test 2 = if([Stock]=BLANK(), var _step1 = [Projected Stock M-1]+[Cumul inbound M-1] - [Cumul 2024 + %] var _step2 = if([Projected Stock M-1]=BLANK(),_step1+[Cumul Stock]+ [Cumul inbound M-1] - [CA 2024 + DEPLETION],_step1) return _step2,[Projected Stock]) Many thanks to all who will take the time to help a Beginner ! Best regards !373Views0likes1CommentHelp with dax to calculate conditional statement by month
I have a problem getting the right formula in my report. I only have two tables, the activity table then just a standard date table to slice time frames. ActivityTable: DateTable Day Month&Year etc. Amount Flag The records are a list of days, an amount for that day, and a Y or N to indicate if it exceeded a threshhold. Looks like this example: 1-Jan 250 n 2-Jan 0 n 3-Jan 0 n 4-Jan 750 y The end result I am trying to build is to get to by month, what percentage of days exceed the threshold so like this: And would need it to do this for each month as dates are added. Basically count how many days within a month/year had activity, then calculate the percentage of those days that had "Y's" flag. So in this example, January had for activity dates and the threshhold was 500, and only 1 of the 4 exceeded that (Y) Jan-23 25% I thought I could count # rows by filtering the table for Y but when I do that, it is not by month. It it just the whole table count of Ys. Does anyone know how to do this? Thanks very much. New to dax and it is very confusing switching from tableau 🙂Solved1.2KViews0likes2CommentsAdd row of Total revenue and total expenses with their calculated amount using m language
hello i have a table combining expenses and revenues with their values in the table below as a small example: Type Level 1 Level 2 Amount Revenue Sales Product A 100 Revenue Sales Product B 300 Expense Payroll Expenses Hr Cost 20 Expense Payroll Expenses Accountant 15 Expense Business Expenses Attorney Fees 5 Expense Business Expenses Consultant Fees 5 Expense Financial Fees Fee A 30 Expense Financial Fees Fee B 50 i want to manually add total revenue and total expenses but i want the amount of total revnue to be sum(amount) if Type = Revenue and total expense amount to be sum(amount) if type="Expense", so how can i do it?Solved1.7KViews0likes8CommentsCalculating IF at row level
Hi, Can anyone suggest where I am going wrong please? I need to create a measure that gives a classification to a row, based on the result of another measure. I have to create this as a measure as I don't have access to make a calculated column. I have made measure 1 and measure2 to use withnin measure 3. When I add measure 1 and 2 to my data the rows remain in the table as expected, the measures are applied for each row. When I filter to show only one row, and add my thrid measure this also works ok. When I show more rows, the measure 3 doens't appear to work at indivdual row level. Can anyone suggest what I need to do for this to work correctly please? Measure 1: TimeDiff_ActualVsPlanned = SUMX('TABLE1', 'TABLE1'[Duration Minutes]-[Planned Minutes]) Measure 2: PlannedVsActualVariant% = divide([TimeDiff_ActualVsPlanned],[Planned Minutes]) Measure 3: OverUnderVarBracket = IF ( [PlannedVsActualVariant%] < -0, "less by under 25%", IF ( [PlannedVsActualVariant%] < -0.251, "underrun by 25-49%", IF ( [PlannedVsActualVariant%] < 0.501, "underrun by 50-84%", IF ( [PlannedVsActualVariant%] < -0.851, "underrun by 85-100%", IF ( [PlannedVsActualVariant%] < -1, "underrun by 100-149%", IF ( [PlannedVsActualVariant%] < -1.5, "underrun by 150% or more", IF ( [PlannedVsActualVariant%] > 1.5, "over by 150% or more", IF ( [PlannedVsActualVariant%] >= 1, "overun 100-149%", IF ( [PlannedVsActualVariant%] > 0.851, "overrun 85-100%", IF ( [PlannedVsActualVariant%] > 0.501, "overrun 50-84%", IF ( [PlannedVsActualVariant%] > 0.251, "overrun 25-49%", IF ( [PlannedVsActualVariant%] > 0, "overrun less than 25%" ) )))))))))))635Views0likes2CommentsTransponer valores de filas en columnas en una tabla con DAX
Estimados Buenas tardes, tengo la siguiente tabla, donde tengo ventas de productos en 2 años respectivos. Necesito que los valores que estan como fila dejarlos como una columa respectiva Desde ya muchas gracias a las respuestas, lo he intentado, pero no logro dar con el resultado esperado. Saludos AlvaroSolved2KViews0likes4CommentsTransformed table with new rows
Good day everyone. I need to make transformed table using data from next table: IDLE_ID START_DT START_TIME END_DT END_TIME IDLE_TYPE 122851 09.09.2019 05:57:00 01.10.2019 09:00:00 Planned 123111 01.10.2019 09:30:00 02.10.2019 17:00:00 Planned I need to make visualization like this (abridged example): IDLE_ID START_DT START_TIME END_DT END_TIME IDLE_TYPE 122851 09.09.2019 05:57:00 09.09.2019 24:00:00 Planned 122851 10.09.2019 00:00:00 10.09.2019 24:00:00 Planned 122851 11.09.2019 00:00:00 11.09.2019 24:00:00 Planned 122851 12.09.2019 00:00:00 12.09.2019 24:00:00 Planned 122851 13.09.2019 00:00:00 13.09.2019 24:00:00 Planned 122851 14.09.2019 00:00:00 14.09.2019 24:00:00 Planned 122851 15.09.2019 00:00:00 15.09.2019 24:00:00 Planned 122851 25.09.2019 00:00:00 25.09.2019 24:00:00 Planned 122851 26.09.2019 00:00:00 26.09.2019 24:00:00 Planned 122851 27.09.2019 00:00:00 27.09.2019 24:00:00 Planned 122851 28.09.2019 00:00:00 28.09.2019 24:00:00 Planned 122851 29.09.2019 00:00:00 29.09.2019 24:00:00 Planned 122851 30.09.2019 00:00:00 30.09.2019 24:00:00 Planned 122851 01.10.2019 00:00:00 01.10.2019 09:00:00 Planned 123111 01.10.2019 09:30:00 01.10.2019 24:00:00 Planned 123111 02.10.2019 00:00:00 02.10.2019 17:00:00 Planned I know, it looks really strange, but i need this visualization for easy count of idle for each day. Also first table was formed in DirectQuery, and i need not to change initial table. Any suggestions come useful. Best regards Alexandr967Views0likes2Comments