Forum Discussion
DAX Formula
- 3 years ago
Hi, BraunReivn
You can try the following methods.
Measure:# of Respondent = CALCULATE(COUNT('Table 2'[Respondent ID]),ALLEXCEPT('Table 2','Table 2'[Date],'Table 2'[Code_Stage]))Satge_HC M = CALCULATE(MAX('Table 1'[Stage_HC]),ALLEXCEPT('Table 2','Table 2'[Code_Stage]))Take Rate = Var _N1=SUMX('Table 2',[# of Respondent]) Var _N2=SUMX('Table 2',[Satge_HC M]) Return DIVIDE(_N1,_N2)Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 3 years ago
If you change the grouping in your visual you also need to change the formula in the measure.
Take Rate = var a = SUMMARIZE('Table 2','Table 2'[Date],'Table 2'[Stage],'Table 2'[Code],"tr",DIVIDE([# of Respondent],[Max HC],0)) return AVERAGEX(a,[tr])see attached.
Thank you once again lbendlin.
To answer your question, yes the users may want to filter by date ranges.
As for changing the Take Rate to Average, is there a way to do it in a measure? Take Rate is a measure, not a calculated column.
My apologies if this is taking longer than it should. Your help is greatly appreciated.
If you look at my proposal you see that I am using AVERAGEX. Can you confirm that you use the same?
- BraunReivn3 years agoRegular Visitor
Yes, I did.
- lbendlin3 years agoSuper User
would you be able to post the sample pbix somewhere?
- lbendlin3 years agoSuper User
If you change the grouping in your visual you also need to change the formula in the measure.
Take Rate = var a = SUMMARIZE('Table 2','Table 2'[Date],'Table 2'[Stage],'Table 2'[Code],"tr",DIVIDE([# of Respondent],[Max HC],0)) return AVERAGEX(a,[tr])see attached.