dax summarize
18 TopicsIgnore Dimension to give median total
I have a simple fact table to show when someone has created a job. It has Date, Persons, Name, and a key field. I would like to show the Total Number of jobs a person has created and a median measure for all Persons so can see how that person comprare to the median, I created this measure and using the persons name from the fact table AgentCreated and it works perfectly giving the median value. VAR PersonTotals = SUMMARIZE ( ALL ( AgentCreated[CreatedBy] ), -- all persons in current date range AgentCreated[CreatedBy], "TotalPerPerson", countrows(AgentCreated) ) -- total qty for that person RETURN MEDIANX ( PersonTotals, [TotalPerPerson] ) I have a DimAgents table that has a relationship with the FactagentCreated using the CreatedBy field and a stand date dimension table relationship on the CreatedDate. Now when I put a slicer on the page using the Name from the DimAgents table and amend my measure to this. the measure doesn't return anything. SUMMARIZE ( ALL ( DimAgents[Full Name] ), // ignore agent slicer DimAgents[Full Name], "TotalPerPerson", CALCULATE ( COUNTROWS ( AgentCreated ), KEEPFILTERS ( VALUES ( 'Date'[Date] ) ) // keep date slicer filter ) ) RETURN MEDIANX ( PersonTotals, [TotalPerPerson] ) I don't know what part I am doing wrong. Thanks for any helpSolved1.5KViews0likes6CommentsDAX - how to combine 3 working measures to create a clean final measure
Hi everyone, I have 3 separate DAX measures. They all work fine in its current state, but want to clean it up. The second measure relies on the first meaure, then the 3rd measure relies on the 2nd measure, just like a hierarchy. For the life of me, I am trying to combine them into one measure. I am having trouble with structuring them within one measure. Can someone please help me? Here are my 3 measures which all work perfectly in its current state: First Measure: --Sum total effort in hours Project Effort Estimate (Hrs) = sum(Effort_Estimate[HoursEffortPerDay]) Second Measure: --Convert Sum of total Hours to FTE Project Effort Estimate (FTE) = VAR NumberofDaysInDate = CALCULATE ( COUNTROWS ( FILTER ( Dim_Date, Dim_Date[IsWorkDay] = TRUE() ))) VAR FullTimeFTE = CALCULATE ( [Project Effort Estimate (Hrs)], FILTER (Effort_Estimate, Effort_Estimate[employmentType] = "FullTime" ) ) / NumberofDaysInDate / 7.5 VAR ContractorFTE = CALCULATE ( [Project Effort Estimate (Hrs)], FILTER (Effort_Estimate, Effort_Estimate[employmentType] = "Contractor" ) ) / NumberofDaysInDate / 8 RETURN FullTimeFTE + ContractorFTE Measure 3: --Summarize the FTE totals SUMX( SUMMARIZE( 'Effort_Estimate', Effort_Estimate[ID], "TotalFTE", [Project Effort Estimate FTE Total] ), [TotalFTE] )Solved925Views0likes4CommentsDynamic ranking of a parameter value
Hi! Would appreciate help figuring out how to create a measure that calculates the dynamic ranking of a parameter value. Let me provide context. I have a 'Transactions' table with columns <ID>, <Weeknum>, <Amount>, <Category>. I'm interested in looking at the aggregate amount per week per ID, and its ranking. My report will have a slicer filter where the user can select different categories, therefore my grouped table becomes dynamic. Additionally, the user is able to input a value as a parameter that represents a weekly aggregate amount. Let's call that parameter value the 'threshold'. The objective is to figure out what rank is this threshold out of the grouped table. Example of original 'Transactions' table ID Weeknum Amount Category 111 30 100 A 111 30 50 B 111 31 200 B 222 31 150 A 222 31 200 A 222 32 300 A Example of Grouped Table and ranking if filtered by Category A ID Weeknum Weekly Amount Ranking ASC 111 30 100 1 222 31 350 3 222 32 300 2 So if the threshold selected = 300, then my ranking measure should return 2. Was thinking of using RANK.EQ function with threshold as the 'number' argument, but I'm stuck at the 'ref' argument. I can't pass a summarized table as the ref argument as it gives me the error that the base table can't be found. Please let me know how can I modify this to achieve the desired result.914Views0likes5CommentsCalculated table with additional calculated column
Dear Group, I would like to create a table that will be based on Union as below: Ranking = Var _Plant1 = CALCULATETABLE(SUMMARIZE('For Plants','For Plants'[Customer],'For Plants'[Plant abb],"Sum of act",sum('For Plants'[Actuals in LC])),FILTER('For Plants','For Plants'[Plant abb]="Plant1")) var _summary = ADDCOLUMNS(_Plant1,"Rank",RANKX(ALL(_Plant1),_Plant1[Sum of act],,DESC,Dense)) Var _Plant2 = CALCULATETABLE(SUMMARIZE('For Plants','For Plants'[Customer],'For Plants'[Plant abb],"Sum of act",sum('For Plants'[Actuals in LC])),FILTER('For Plants','For Plants'[Plant abb]="Plant2")) var _summary2 = ADDCOLUMNS(_Plant2,"Rank",RANKX(ALL(_Plant2),_Plant2[Sum of act],,DESC,Dense)) RETURN union(_summary,_summary2) Unfortunately, this doesn't work. It works if I do it step by step - first create a separate table per plant, then add a column with ranking and then create a separate table with UNION, but as I have 10 plants, I would like to avoid creation of 11 tables. The overall idea is to give rank to per customer per plant based on sum of actuals. Could you please advise how to do it all at one? Thank you in advance.Solved729Views0likes2CommentsHow to use SUMMARIZE inside a calculated column?
I'm trying to get information from aggregated version of my table into my original table as a column, but im not sure how to do it. Find the sample ecxample below The table contains 4 column - EMP_ID, DATE, MONTHLY SALARY, DESIGNATION I want to create new column called TOTAL SALARY which is the sum of salary for each employee available in data. There is time filter as well, like if I select 6 months in the filter visual the total salary should be populated as total six months salary. I couldn't find a way to do it in PBI using DAX/POWER QUERY. Please help me on this!! ThanksSolved1KViews0likes2CommentsCreating a dynamic summarization table based on measure values
Hello everybody! I have categorized my clients into 4 LRFM segments: Key, Frequent, Spender & Uncertain. Using measure. Client Status A Key B Uncertain C Uncertain D Frequent E Key F Key G Frequent H Key I Spender J Spender K Frequent L Uncertain I want a summarization table that shows something like this. Status # Clients Key 4 Uncertain 3 Frequent 3 Spender 2 Notice that my output in the first table is measure. But we can’t use measure as a legend. I don’t want to use columns because I want it to be dynamic and the summarization values change based on the slicers I have. What should I do? My lrfm measure: LRFM Analysis LRFM = IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="High","Key", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="High","Key", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="Low","Key", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="Low","Key", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="High","Spender", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="High","Spender", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="Low","Spender", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="High" && [If Normalize R LRFM]="Low","Spender", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="High","Frequent", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="High","Frequent", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="Low","Frequent", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="High" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="Low","Frequent", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="High","Uncertain", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="High","Uncertain", IF([If Normalize L LRFM]="High" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="Low","Uncertain", IF([If Normalize L LRFM]="Low" && [If Normalize F LRFM]="Low" && [If Normalize M LRFM]="Low" && [If Normalize R LRFM]="Low","Uncertain","Not Found"))))))))))))))))Solved917Views1like3CommentsQuestion about filters in summarize
Hello, I noticed an unexpected result in my DAX Formula that I can't explain and I'm pretty sure that I'm just missing an info. Here it is : IF ( ISINSCOPE ( GEOGRAPHY[REGION_NAME] ), SUMX ( FILTER ( SUMMARIZE ( INVOICES, GEOGRAPHY[REGION_NAME], "Spend geo", IF ( ISFILTERED ( DIM_CALENDAR[YEAR] ), [Spend], [Spend YTD] ), "# Invoices", [Invoice Quantity Period] ), [# Invoices] >= MinInvoiceValue && [# Invoices] <= MaxInvoiceValue && [Spend geo] <= MAX ( 'Spend Threshold'[Value] ) && [Spend geo] >= MIN ( 'Spend Threshold'[Value] ) ), [Spend geo] ) ) My problem is that the ISFILTERED function is always returning True even though there are no selection, I tried it on a blank page even to be sure no filter is hidden somewhere. My thought was that the FILTER function is biasing the result, but can't find any information to confirm my hunch. Thanks a lot468Views0likes1CommentSUMX SUMMARIZE group by company in a table
Hi all. I have a simple table made of 2 fields and 1 measure: where _Sales Denominator YA ORG = CALCULATE( [_Sales YA ORG] , ALL(Company[Company], Company[Brand],Company[Sub Brand], Company[Variant]) , ALLSELECTED(Period[Period]) ,ALLSELECTED('Market Breakdown'[Country]) ,ALLSELECTED('Organic Claim'[Organic Claim]) , VALUES('W Segment'[W Segment]) , VALUES('Market Brkdown'[Hier Level Name]) , VALUES('Ad Hoc Analysis View'[Category]) , VALUES('Ad Hoc Analysis View'[Segment]) ) what I want to do is to delete the country field and obtain one row for each company with the sum of each _Sales denominator YA ORG for each company. For example I want this result: Company _Sales denominator YA ORG PRIVATE LABEL 3402952 STRAUSS GROUP 206 TCHIBO 36854 TONYS COFFEE ROASTERS 2895 VERGNANO 1131 WERTFORM 3987 WICKED JOE LLC 23592 WOSEBA 1035 So what I've tried is to modify the measure this way: _Sales denominator YA ORG= SUMX( SUMMARIZE( 'Ad Hoc Analysis View', 'Ad Hoc Analysis View'[Company], "x_per_company", CALCULATE( [_Sales YA ORG], ALL(Company[Company], Company[Brand],Company[Sub Brand], Company[Variant]), ALLSELECTED(Period[Period]), ALLSELECTED('Market Brkdown'[Country]), ALLSELECTED('Organic Claim'[Organic Claim]), VALUES('W Segment'[W Segment]), VALUES('Market Brkdown'[Hier Level Name]), VALUES('Ad Hoc Analysis View'[Category]), VALUES('Ad Hoc Analysis View'[Segment]) ) ), [x_per_company] ) But I obtain this table, with summarized values that are different from what I expect: Do you have any suggestion? Thanks509Views0likes1CommentSUMMARIZE two tables many to many Relationship
I'm trying to get this in Excel (Edit DAX in Table) and I need the column 'table2'[DesPro], but I can't figure it out how to do that. So far, I have: FILTER( SUMMARIZE( table1, table1[NF Saída], table1[Título], table1[Total], table1[Ult. Pgto], 'table2'[DesPro] -- where table1[NF Saída]='table2'[Nota Fiscal] with many to many relationship. A union table with all distinct values from both tables had been created ), table1[Ult. Pgto] <> BLANK()&&table1[Ult. Pgto] >= DATE(2023, 1, 1) ) I appreciate any help.1.2KViews0likes4CommentsDAX table to create a revenue funnel visual?
Hi! my main fact table is financial transactions which look pretty much like this: date type amount 10/12/22 revenue 100$ 10/12/22 expense 50$ 01/01/23 revenue 100$ 01/01/23 expense 30$ 05/01/23 revenue 150$ 05/01/23 expense 75$ I want to create a revenue funnel visual that shows the conversion between the revenue and the margins. from what I understand, I need to get a table at this structure ( I can drop the year but I want to keep it for future visualization) year type amount 2022 revenue 100$ 2022 margins (100$-50$) = 50$ 2023 revenue (100$+150$) = 250$ 2023 margins (100$+150$) - (30$+75$) = 145$ Then I will drag the type to the funnel group and the amount to the funnel value. How can I create this table using DAX? Thanks! Tal549Views0likes1Comment