I have a visual that I want to calculate as a percentage above or below a target goal. Let’s say I have a table head(5) that looks something like this:
id | Date | Inbound Requests | Outbound Responses |
---|---|---|---|
1 | 1/1/2021 | 5 | 3 |
2 | 1/2/2021 | 7 | 1 |
3 | 1/3/2021 | 3 | 2 |
4 | 1/4/2021 | 3 | 1 |
5 | 1/5/2021 | 9 | 7 |
And the aggregate numbers show as:
842 Inbound Requests
312 Outbound Responses
Which comes out to a response rate of 37.05% –
My target response rate is 60%.
What I want to show is the response rate vs the goal, as a percentage.
Here’s my dax:
Measure 1:
ResponseGoal = .6
Measure 2:
Response Rate = IF(SUM(data[Inbound Requests]) = 0, BLANK(), SUM(data[Outbound Responses])/SUM(data[Inbound Requests]))
Measure 3:
Current Vs Goal Response Percent = IF(SUM(data[Inbound Requests]) = 0, BLANK(),
(DIVIDE(([Response Rate] - [ResponseGoal]),[ResponseGoal], 0)))
So my formula is then packaged up to be a simple card visual, but is coming up differently versus the aggregate numbers. I’m not sure why this is happening: