Forum Discussion
socksinbox
7 years agoHelper 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
cheers,
1 Reply
- Ani1991Resolver 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")RETURNIF(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.Thanks,Ani