Forum Discussion
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:
| Ticket Category _CSG | Leg - Date | Calls |
| Point of Sale::Printing | 15-Jun-24 | 1 |
| Restaurant Management::Employees | 16-Jun-24 | 1 |
| Point of Sale::Printing | 15-Jun-24 | 1 |
| Point of Sale::Printing | 15-Jun-24 | 1 |
| Restaurant Management::Licensing | 15-Jun-24 | 1 |
| Windows Issue::Operating System | 16-Jun-24 | 1 |
| Point of Sale::Reports | 15-Jun-24 | 1 |
| Credit Cards::Batching | 15-Jun-24 | 1 |
| Point of Sale::Close Day | 15-Jun-24 | 1 |
| Windows Issue::Windows Services | 16-Jun-24 | 1 |
| Point of Sale::Balance Drawer/Cashout | 15-Jun-24 | 1 |
| Point of Sale::Printing | 15-Jun-24 | 1 |
| Point of Sale::Order Entry | 16-Jun-24 | 1 |
- Anonymous2 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 / countpermonthDifference = 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
- AnonymousNot 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 / countpermonthDifference = 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.