Forum Discussion

YcnanPowerBI's avatar
YcnanPowerBI
Icon for Helper II rankHelper II
2 years ago
Solved

Calculate % difference in MOM measures

Hoping this is a simple one for someone.

 

I have a measure that divides repeat callers by all callers within 2 days for our repeat rate.  I am diplaying that measure monthly.  I would like to calculate the difference +/- from May to June and so on. Any help is greatly appreciated.

 

Measure being used:

Repeat Rate = DIVIDE([1 Count Repeats],[1 Count All Calls])
 
Sample Data:
Ticket Category _CSGLeg - DateCalls
Point of Sale::Printing15-Jun-241
Restaurant Management::Employees16-Jun-241
Point of Sale::Printing15-Jun-241
Point of Sale::Printing15-Jun-241
Restaurant Management::Licensing15-Jun-241
Windows Issue::Operating System16-Jun-241
Point of Sale::Reports15-Jun-241
Credit Cards::Batching15-Jun-241
Point of Sale::Close Day15-Jun-241
Windows Issue::Windows Services16-Jun-241
Point of Sale::Balance Drawer/Cashout15-Jun-241
Point of Sale::Printing15-Jun-241
Point of Sale::Order Entry16-Jun-241
 
Expected Outcome:

 


 


 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi YcnanPowerBI 

     

    First, you can use the following DAX to get the repeated calls every two days:

    Repeat Count per two day = VAR _selectdate = DAY(SELECTEDVALUE('Table'[Leg - Date]))
    RETURN
    CALCULATE(COUNTROWS('Table'),FILTER('Table',DAY('Table'[Leg - Date])=_selectdate||DAY('Table'[Leg - Date]=_selectdate+1)))

     

    Then you can use the following DAX to get the ratio of repeat calls to total calls and the difference for each month:

    Divide = 
    VAR _selectmonth = MONTH(SELECTEDVALUE('Table'[Leg - Date]))
    VAR reprtcount = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Leg - Date]) =_selectmonth&&[Repeat Count per two day]<>1))
    VAR countpermonth = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Leg - Date])=_selectmonth))
    RETURN
    reprtcount / countpermonth
    Difference = VAR _selectmonth = MONTH(SELECTEDVALUE('Table'[Leg - Date]))
    RETURN
    [Divide] -  CALCULATE([Divide],FILTER(ALL('Table'),MONTH('Table'[Leg - Date])= _selectmonth-1))

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi YcnanPowerBI 

     

    First, you can use the following DAX to get the repeated calls every two days:

    Repeat Count per two day = VAR _selectdate = DAY(SELECTEDVALUE('Table'[Leg - Date]))
    RETURN
    CALCULATE(COUNTROWS('Table'),FILTER('Table',DAY('Table'[Leg - Date])=_selectdate||DAY('Table'[Leg - Date]=_selectdate+1)))

     

    Then you can use the following DAX to get the ratio of repeat calls to total calls and the difference for each month:

    Divide = 
    VAR _selectmonth = MONTH(SELECTEDVALUE('Table'[Leg - Date]))
    VAR reprtcount = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Leg - Date]) =_selectmonth&&[Repeat Count per two day]<>1))
    VAR countpermonth = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),MONTH('Table'[Leg - Date])=_selectmonth))
    RETURN
    reprtcount / countpermonth
    Difference = VAR _selectmonth = MONTH(SELECTEDVALUE('Table'[Leg - Date]))
    RETURN
    [Divide] -  CALCULATE([Divide],FILTER(ALL('Table'),MONTH('Table'[Leg - Date])= _selectmonth-1))

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.