dax tables
3 TopicsVery high total table results, does not average.
HELP PLEASE! Hello, I have a problem that I have been looking for the solution for several days but I can't find it. I would be very grateful if someone could help me, because it is something that I will have to use a lot and I have no way to solve it. I have a table with data, in which when I make the comparison to see the % that we have gone up or down with respect to last year gives me very high results. When I do the comparison by date I get the total result very high, but when I do it by week and month I get all the results very high, both the total and the partial results. What I want is that the total result (like the weekly and monthly ones) gives me the average of all the results that compose it, and it is impossible that these very high numbers that I get are averages. I leave here below the images in which you can see my case. I am also going to leave the formula that I am using for it, since I believe that the solution may be that the dax formula that I am using is wrong. The formula is the following: R_LYDay(B) = VAR _actual_total = SUMX( VALUES(calendar_table[Date]), SUM(R) ) VAR _LY_total = SUMX( VALUES(calendar_table[Date]), CALCULATE( SUM(R), DATEADD(calendar_table[Date], -364, DAY) ) ) RETURN DIVIDE(_actual_total - _LY_total, _LY_total, 0) When I put “R” is where the main measurement is, but for confidentiality I prefer not to share. I would be very grateful if someone could give me a solution. Thank you very much in advance.Solved815Views0likes4CommentsSWITCH over SUMMARIZECOLUMNS based on parameter value
Hello, I have created parameter and based on that I would like to calculate dynamic table using SUMMARIZECOLUMNS function. Is that possible at all? Below you can find my DAX idea using SWITCH and IF however it does not work. I need a table as a result of SWITCH / IF statement. EVALUATE SWITCH ( TRUE (), @Selected_Values = 0, SUMMARIZECOLUMNS ( 'Test Table'[Column] ), SUMMARIZECOLUMNS ( 'Test Table'[Column], KEEPFILTERS ( FILTER ( ALL ( 'Sources'[Source] ), PATHCONTAINS ( @Source, 'Sources'[Source] ) ) ), "Calculation", COUNTROWS ( 'Test Table' ) ) ) And with IF: EVALUATE IF ( @Selected_Values = 0, SUMMARIZECOLUMNS ( 'Test Table'[Column] ), SUMMARIZECOLUMNS ( 'Test Table'[Column], KEEPFILTERS ( FILTER ( ALL ( 'Sources'[Source] ), PATHCONTAINS ( @Source, 'Sources'[Source] ) ) ), "Calculation", COUNTROWS ( 'Test Table' ) ) ) Thanks871Views0likes2CommentsDAX measure with left outer join, multiple to multiple
I have one table in data model with one row per employee, their current end previous manager, and their current and previous output: EmployeeID Current Manager Current Output Previous Manager Previous Output 1 A 10 B 5 2 A 20 A 15 3 B 30 A 40 4 B 5 B 10 In the reports view, I show the sum of current and previous output by current and previous manager respectively: Current Manager Current Output A 30 B 35 And: Previous Manager Previous Output A 55 B 15 I would like to left join the 'current output' table with the 'previous output' table on Current Manager = Previous Manager so I can calculate the output delta. What I want is this: Current Manager Current Output Previous Output Delta Output A 30 55 -25 B 35 15 20 I have tried writing a measure to give the answer, but can't figure out how to pass the values of the delta: Create Delta Table = VAR x2=GENERATEALL( SUMMARIZE('EmployeeTable', EmployeeTable'[Current Manager], "Sum Current Output", CALCULATE (SUM('EmployeeTable'[Current Output]))) ,SUMMARIZE('EmployeeTable', 'EmployeeTable'[het_name], "Sum Previous Output", CALCULATE (SUM('EmployeeTable'[Previous Output]))) ) RETURN x2Solved856Views0likes2Comments