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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
socksinbox
Helper I
Helper I

Adding Variance measure between current & previous month in a matrix visual

Hi,

 

I have a matrix visual which shows categories on rows and months on columns. 
Each cell shows the count of the incident for a particular category in a given month.

 

Now i have to add another column for variance as shown below? How can I do this in PowerBI

 

2019-08-19 19_53_07-Book1 - Excel.png

 

cheers,

 

1 REPLY 1
Ani1991
Resolver III
Resolver III

Hi @socksinbox ,

You can try something like below.

Create a measure like one below,

 

Variance =
var variable = CALCULATE(SUM(Categories[Value]),Categories[Month]="Jun")-CALCULATE(SUM(Categories[Value]),Categories[Month]="May")
RETURN
IF(ISBLANK(variable),0,variable)
 
Remember, I have hardcoded the value here just to explain how this can be achieved because I am not aware whether the variance is calculated with reference to any slicer selection. That been the case then you need to just replace the hardcoded value with the SELECTEDVALUE using the SELECTEDVALUE function.
 
image.png
Thanks,
Ani

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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