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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gomezc73
Helper V
Helper V

Add a Fix Column to 'Columns subtotal' in Matrix.

Hi Experts,

 

  I have a matrix to show the inventory by three diferent Categories:

  • Uniforms
  • Beverages
  • Food

   That amounts are calculated and Vary by month.

   

    The user can select from the Slicer 1,2 or all categories and the Matrix show a total by Categories selected without issues.

    

      The results is similar to this if all categories are selected.

      

RestaurantBeveragesFoodUniformsTotal
Rst-0125030012001750
Rst-025003508601710
Rst-036004507501800
Rst-048006007002100
Rst-0512001678002167

   

Now, the user wants show in the matrix two additional columns(Initial Setup and Other setup) with Fixed values by Restaurant, but he wants to add the fixed amounts in the 'total'

 

NOTE: that amounts  for Initial Setup and Other setup are fixed By restaurant (no calculations)

 

By Eaxmple:

 

If the user ONLY select Beverages and Food, the TOTAL must sum Beverages and food PLUS Initial setup and Other setup.

 

I added the new columns in the row fields and it are showed in the Matrix.

 

RestaurantInitial setupOther SetupBeveragesFoodTotal
Rst-0110050250300700
Rst-021201505003501120
Rst-033001206004501470
Rst-04256808006001736
Rst-052135012001671630

 

How can I do that, if in the categories I only have the three categories that I already mentioned

gomezc73_0-1702759165371.png

 

In other words i need that the last colum (Total) summarize the amounts in categories selected Plus the two fixed values(Initial Setup and Other setup). Is it Possible?

 

I really appreciate your help..

    

  

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gomezc73 ,

You can follow these steps to solve your problem:

1.Unpivot all categories column.

vyifanwmsft_0-1702868403321.png

 

2.Add a column.

vyifanwmsft_1-1702868433036.png

 

Column =
'Table'[Initial setup] + 'Table'[Other Setup]

 

 

3.Add a measure.

 

total =

CALCULATE (

    SUM ( 'Table'[Value] ),

    FILTER ( 'Table', 'Table'[Restaurant] = SELECTEDVALUE ( 'Table'[Restaurant] ) )

)

    + SELECTEDVALUE ( 'Table'[Column] )

 

 

Output:

vyifanwmsft_2-1702868568588.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Yifan Wang

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

1 REPLY 1
Anonymous
Not applicable

Hi @gomezc73 ,

You can follow these steps to solve your problem:

1.Unpivot all categories column.

vyifanwmsft_0-1702868403321.png

 

2.Add a column.

vyifanwmsft_1-1702868433036.png

 

Column =
'Table'[Initial setup] + 'Table'[Other Setup]

 

 

3.Add a measure.

 

total =

CALCULATE (

    SUM ( 'Table'[Value] ),

    FILTER ( 'Table', 'Table'[Restaurant] = SELECTEDVALUE ( 'Table'[Restaurant] ) )

)

    + SELECTEDVALUE ( 'Table'[Column] )

 

 

Output:

vyifanwmsft_2-1702868568588.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Yifan Wang

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

 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.