'filter'
2 TopicsCount new value as a single frequency, instead of twice, in the same DAX formula
I have a table (actions_taken) with columns called project_number, action_effective_dt, and action_name. All these values can and do repeat. Each project number can repeat & have multiple action names associated with it & multiple action effective dates. One of you helped me write the DAX formula below (thank you!), but I now want to modify this formula to count the “IE/FE” as a single occurrence. Currently the “IE/FE” is being double counted. DAX Formula: ClosingsAction = VAR CurrentProject = actions_taken[project_number] VAR CurrentDate = actions_taken[action_effective_dt] VAR HasA = CALCULATE( COUNTROWS(actions_taken), ALL(actions_taken), -- Overrides context transition to scan the whole table actions_taken[project_number] = CurrentProject, actions_taken[action_effective_dt] = CurrentDate, actions_taken[action_name] = " Initially Endorsed" ) > 0 VAR HasB = CALCULATE( COUNTROWS(actions_taken), ALL(actions_taken), -- Overrides context transition to scan the whole table actions_taken[project_number] = CurrentProject, actions_taken[action_effective_dt] = CurrentDate, actions_taken[action_name] = "Finally Endorsed" ) > 0 RETURN SWITCH( TRUE(), -- If both A and B exist on same date for the same project actions_taken[action_name] IN {"Initially Endorsed","Finally Endorsed"} && HasA && HasB, "IE/FE", -- Individual mappings actions_taken[action_name] = "Initially Endorsed", "IE", actions_taken[action_name] = "Finally Endorsed", "FE", actions_taken[action_name] = "Firm Application Withdrawn", "W", actions_taken[action_name] = "Firm Commitment Expired", "E", BLANK() ) Sample data: Project_number Action_effective_dt Action_name Ghj123 5/20/2026 Initially Endorsed Ghj123 5/20/2026 Finally Endorsed Hop963 4/8/2026 Firm Commitment Expired Lty789 3/7/2026 Firm Application Withdrawn Dsw493 3/7/2026 Firm Commitment Expired Kjh259 3/5/2026 Initially Endorsed Table outcomes with reclassified categories from “ClosingsAction” column: Action_Name Frequency IE/FE 2 (I want this to be counted as a single action/ occurrence) E 2 W 1 IE 1Solved1.4KViews0likes8CommentsOverride filters
These are the columns in the Date Info table. First Day of Week: Sunday is the first day of week First Day of Week_RankDESC: Rank based on First Day of Week in descending order (i.e., the latest week has the lowest rank = 1). CurrentYear_WeekMinDate: Earliest date of the current week. PriorYear_WeekRank: Rank of the same week prior year PriorYear_WeekMinDate: Earliest date for the same week prior year PriorYear_WeekRankAdd10 = PriorYear_WeekRank + 10 PriorYear_WeekMinDateAdd10Weeks = Earliest date for the week corresponding to PriorYear_WeekRankAdd10. https://drive.google.com/file/d/1N-bLYLpyjs3K7uQHWm9QDC4DPpydXRS-/view?usp=sharing 1. I can understand why the current year information is returned, but I don't understand why PriorYear_WeekRank is returned while PriorYear_WeekMinDate and PriorYear_WeekMinDateAdd10Weeks are not. e.g. End Date = 19 Jul 2025 (Sat) For the row where the First Day of Week is 13 Jul 2025, it includes dates from 13 to 19 Jul 2025. Why PriorYear_WeekRank can be returned when the date is outside of the above range? PriorYear_WeekRank = VAR CurrentYearWeekMinDate = [CurrentYear_WeekMinDate] VAR step1 = CurrentYearWeekMinDate - WEEKDAY(EDATE(CurrentYearWeekMinDate, -12), 2) +7 VAR step2 = EDATE(step1, -12) RETURN CALCULATE(MIN('Date'[First Day of Week_RankDESC]), 'Date'[Date] = step2) 2. How to return PriorYear_WeekMinDate and PriorYear_WeekMinDateAdd10Weeks Thanks in advance:)Solved8.6KViews0likes4Comments