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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gomezc73
Helper IV
Helper IV

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
v-yifanw-msft
Community Support
Community Support

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
v-yifanw-msft
Community Support
Community Support

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.