Forum Discussion

BraunReivn's avatar
BraunReivn
Regular Visitor
3 years ago
Solved

DAX Formula

Good day! Please pardon me, I'm new in this community and a complete newbie in PBI. I'll try to be clear and detailed as possible. So, here's my problem. I have 2 tables - Table 1 and Table 2. Ta...
  • v-zhangti's avatar
    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.

  • lbendlin's avatar
    lbendlin
    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.