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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Adding Custom calculated Columns to Table

Hello everyone,

 

I'm trying to create a table as shown below, I have regions and sales, I want to group sales by months as M1: January... 

and then add another column to calculate the variance between latest month and 2 previous months.

The thing that I'm struggling with is adding new calculated columns such as the average of the latest 2 months and variance (I am using a matrix table but then I can't add the latest month and variance)

 

Appreciate any help or any resources on creating complex custom tables.

 

RegionM12M1M2M3Latest full monthAvg. Of Latest 2 MonthsVariance Prior Month Variance
Region 1                 44                 23                 43                 44                                       43                                            3428%                 2387%
Region 2                 44                 23                 34                 54                                       34                                            341%                 2348%
Region 3                 33                 43                 34                 34                                       34                                            38-11%                 43-21%
Region 4                 22                 43                    4                 43                                          4                                            33-88%                 43-91%
Region 5                 33                 45                 32                 33                                       32                                            39-18%                 45-29%
Total              176              177              147              208                                    147                                         177-17%              177-17%
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

For calculating variance in Power BI, we can use DAX function such as VAR.S or VAR.P.

VAR.S function (DAX) - DAX | Microsoft Learn
VAR.P function (DAX) - DAX | Microsoft Learn

For calcualting the average of the latest 2 months, we can also use DAX formula to achieve it. I found some similar posts for your reference.

Solved: SOLVED.DAX Measure previous 3 months average - Microsoft Fabric Community
Solved: Average of 3 Months - Microsoft Fabric Community
Solved: dynamically calculate average for last 3 months sa... - Microsoft Fabric Community

Best Regards

Stephen Tao

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
Anonymous
Not applicable

Hi @Anonymous ,

 

Unfortunately, you cannot add a single column in the matrix visual which is by design.

If you add a field to the Values of the matrix, it will only add one column of values for each month, as shown below:

vstephenmsft_0-1711101110874.png

It's recommended that you try adding these columns with a table visual.

 

Best Regards

Stephen Tao

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 Stephen,

thanks for the reply, I'm new to Power BI, I've used Qlik Sense which was very easy to add ad-hoc columns to the table but that's not the case with Power BI, do you have any resources to share on how to do Table Visual?

Anonymous
Not applicable

Hi @Anonymous ,

 

For calculating variance in Power BI, we can use DAX function such as VAR.S or VAR.P.

VAR.S function (DAX) - DAX | Microsoft Learn
VAR.P function (DAX) - DAX | Microsoft Learn

For calcualting the average of the latest 2 months, we can also use DAX formula to achieve it. I found some similar posts for your reference.

Solved: SOLVED.DAX Measure previous 3 months average - Microsoft Fabric Community
Solved: Average of 3 Months - Microsoft Fabric Community
Solved: dynamically calculate average for last 3 months sa... - Microsoft Fabric Community

Best Regards

Stephen Tao

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.