Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, could someone help me figure out how to write a dynamic measure that looks at any remaining records when filtering and determines the max of the remaining records relative to it's own value? I've attempted various things such as:
Max_Of_Other_Stages = CALCULATE(MAX(OppHistory[StageNameValue]),ALLEXCEPT(OppHistory,OppHistory[StageNameValue]))
This is not behaving as expected since it always returns 11.
This is a one step toward the true goal which is to calculate the days between those two records, each row's date vs. the max of the records that have a stage value < its own.
Any help will be much appreciated!
Solved! Go to Solution.
Add a filter to the DAX formula.
Max_Of_Other_Stages_In_The_Same_Opportunity = CALCULATE ( MAX ( OppHistory[StageNameValue] ), FILTER ( ALLEXCEPT ( OppHistory, OppHistory[OpportunityID] ), OppHistory[StageNameValue] < MAX ( OppHistory[StageNameValue] ) ) )
Add a filter to the DAX formula.
Max_Of_Other_Stages_In_The_Same_Opportunity = CALCULATE ( MAX ( OppHistory[StageNameValue] ), FILTER ( ALLEXCEPT ( OppHistory, OppHistory[OpportunityID] ), OppHistory[StageNameValue] < MAX ( OppHistory[StageNameValue] ) ) )
Hi Eric,
I noticed that this does not respect filters that have been selected... For example if I exclude stage name value 4, then I would expect the value for anything StagenameValue of 6 to recognize that the max of the records below it has now become the -1 value.
Do you know how to do this?
Thanks,
Joaquin
Thanks Eric. I was also able to come up with a similar alternative...
Max_Of_Other_Stages = if(HASONEVALUE(OppHistory[StageNameValue]),
CALCULATE(MAX(OppHistory[StageNameValue]),
ALLEXCEPT(OppHistory,OppHistory[StageNameValue]),
OppHistory[StageNameValue]<values(OppHistory[StageNameValue])),
blank())
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |