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 lbendlin for noticing my post and taking the time to answer.
So I followed everything however it's not giving me the correct overall take rate. I wonder what's missing here.
I'd like so much to attach my file however I can't seem to find the option to do it so I'm pasting a screenshot instead.
Hoping once again for your help.
Change the implicit measure for the Take Rate column to Average rather than Sum.
You will need to decide if this should be a measure (can be influenced by filters) or a calculated column (immutable). Are you planning to allow your users to filter by date ranges?
- BraunReivn3 years agoRegular Visitor
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.
- lbendlin3 years agoSuper User
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.