Forum Discussion

olimilo's avatar
olimilo
Post Prodigy
9 years ago
Solved

Converting Excel Formulas to DAX

Hi guys, I'm trying to convert the following formulas from Excel to DAX, but they don't seem to be working as they should. I tried a DAX and I'm getting the overall numbers correct, but when I divide them into regions, that values don't add up as they should.

 

Data!D = Region

Data!AQ = TAT

 

 

=COUNTIFS(Data!D: D,B34,Data!AQ:AQ,"<6")/COUNTIFS(Data!D: D,B34,Data!AQ:AQ,"<>")

Measure =
DIVIDE(
 CALCULATE(COUNTROWS('Timeliness Data'), FILTER('Timeliness Data', 'Timeliness Data'[TAT] <= 5))
 , COUNTROWS(ALL('Timeliness Data')))
)

 

  • I think I got it: I just had to remove the ALL from the denominator.

     

    Measure =
    DIVIDE(
     CALCULATE(COUNTROWS('Timeliness Data'), FILTER('Timeliness Data', 'Timeliness Data'[TAT] <= 5))
     , COUNTROWS('Timeliness Data'))
    )

     

1 Reply

  • olimilo's avatar
    olimilo
    Post Prodigy

    I think I got it: I just had to remove the ALL from the denominator.

     

    Measure =
    DIVIDE(
     CALCULATE(COUNTROWS('Timeliness Data'), FILTER('Timeliness Data', 'Timeliness Data'[TAT] <= 5))
     , COUNTROWS('Timeliness Data'))
    )