Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
dax
Community Support
Community Support

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
dax
Community Support
Community Support

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.

Anonymous
Not applicable

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!

 

Cmcmahan
Resident Rockstar
Resident Rockstar

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.