Forum Discussion

ronaldbalza2023's avatar
ronaldbalza2023
Icon for Continued Contributor rankContinued Contributor
5 years ago
Solved

DAX Query refactor

Hi everyone, I have a dax query that calculates the jobturnaround time. However, it took 7191ms to load using the matrix table. Could someone help out to refactor it? Thanks! 🙂 Here's the measure...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    5 years ago

    Hi,

    If we want to see only those line items in the visual where the measure returns a non 0 value, then why are we even using an IF() or a COALESCE().  Why not just use this

    =CALCULATE(AVERAGE(Jobs[Days Between Start Date & Completed Date]),USERELATIONSHIP(Jobs[Jobs Job Completed Date],'Date'[Date]),USERELATIONSHIP(Jobs[Job Manager ID],'Unique Staff'[StaffID]),USERELATIONSHIP(Jobs[Jobs Job Client ID],Clients[ID]))