cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Munwar Frequent Visitor
Frequent Visitor

How to get " Deviation from target " value for specific category of data as Total in Matrix visual

Hi All,

I'm facing hard to get customize Totals value in Matrix.

I have columns

'Status'(on Rows) values as Completed, Unable, Incomplete 

Monthyear(on columns) as Jan2019,Feb2019,etc..

and taking record count as Values

in a Matrix . (I'm getting 'percent of column total' from 'Show values' for each column)
my requirement is to get % of record count diviated from target for 'Completed' value only (yellow highlighted in below screen).

per Ex:
Target goal = 85%
Deviation from Target goal = observed 'Completed' record count % - Target goal %

 

Matrix visual.PNG

 

 

 

 

 

 


Any help or advice would be appriciated.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to get " Deviation from target " value for specific category of data as Total in

Hi Munwar,

If your data sample is similar  to  below, you could try below measures

statusdatetarget

Completed1/1/20190.85
Unable1/1/20190.85
Incompleted1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Unable1/1/20190.85
Unable1/1/20190.85
Incompleted1/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Unable2/1/20190.85
Incompleted2/1/20190.85
Incompleted2/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Incompleted3/1/2019

0.85

 

 

 

You could create two measures like below

Measure 3 =
CALCULATE ( COUNT ( test1[status] ) )
    / CALCULATE (
        COUNT ( test1[status] ),
        FILTER ( ALL ( test1 ), test1[date] = MIN ( test1[date] ) )
    )
Measure 4 =
IF (
    HASONEVALUE ( test1[status] ),
    [Measure 3],
    CALCULATE ( [Measure 3], test1[status] = "Completed" )
        - MIN ( test1[target] )
)

182.PNG

Best Regards,
Zoe Zhi

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

View solution in original post

3 REPLIES 3
Super User
Super User

Re: How to get " Deviation from target " value for specific category of data as Total in

So it looks like your issue is with the matrix total line not being as easily customizable as you would wish.

 

Quick question, what are you using to populate each field? Is that a measure that returns 50%/20%/30% or a data field?  What expression are you using for that?

 

Long story short, you want to create a measure using ISINSCOPE to define different behavior based on where in the matrix you are calculating.

 

So for your example, if the values you currently have are calculated by a measure called [Observed %], you would write a measure like this:

[Observation % for Matrix] = 
IF( ISINSCOPE(Table[Status]), 
    [Observed %], 
    CALCULATE( [Observed %], Table[Status] = "Completed") - 0.85
)

You'll have to replace terms with the actual names of your data columns/measures, but this is the basic form of a measure that will give a different result for the subtotal row/column than each individual row.

Community Support Team
Community Support Team

Re: How to get " Deviation from target " value for specific category of data as Total in

Hi Munwar,

If your data sample is similar  to  below, you could try below measures

statusdatetarget

Completed1/1/20190.85
Unable1/1/20190.85
Incompleted1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Completed1/1/20190.85
Unable1/1/20190.85
Unable1/1/20190.85
Incompleted1/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Completed2/1/20190.85
Unable2/1/20190.85
Incompleted2/1/20190.85
Incompleted2/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Completed3/1/20190.85
Incompleted3/1/2019

0.85

 

 

 

You could create two measures like below

Measure 3 =
CALCULATE ( COUNT ( test1[status] ) )
    / CALCULATE (
        COUNT ( test1[status] ),
        FILTER ( ALL ( test1 ), test1[date] = MIN ( test1[date] ) )
    )
Measure 4 =
IF (
    HASONEVALUE ( test1[status] ),
    [Measure 3],
    CALCULATE ( [Measure 3], test1[status] = "Completed" )
        - MIN ( test1[target] )
)

182.PNG

Best Regards,
Zoe Zhi

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

View solution in original post

Munwar Frequent Visitor
Frequent Visitor

Re: How to get " Deviation from target " value for specific category of data as Total in

Hi @dax , @Cmcmahan 

 

Thank you for your time. My bad, i was unable to fix this with the inputs received... i feel the requirement was not get framed well earlier hence i'm
sharing a sample pbix (dropbox link) contains data and requirement . This report has two matrix for plans 'abc' and 'xyz' with complete and incomplet counts
summary in 'column total percentages'. Each plan has different goal number percentages.
Finally Total would be as Deviation From Goal = Observed complete % (1 st row) - respective plan goal %
Yellow highlighted in below.Deviation from goal screen1.PNG

 

Please download the pbix file from here:

https://www.dropbox.com/s/8br57btqwxopp6j/Custom%20Total%20sample%20file.pbix?dl=0

 

Thankyou!

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 297 members 3,148 guests
Please welcome our newest community members: