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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Not applicable

Matrix total : total of a column in sum and the total of the other column in average

Hi everyone,


I am looking to make a matrix that can show the weight shipped per month and the share of maritime on the total for each month/year. So far so good :



The problem is that on my totals, I do find the total weight shipped (sum) but on the total SEA% I would like to have an average for the year, but this is not the case.



For the weight I used this formula Total weight formula = SUMX(File1,File1[Total Weight])

For the Sea%, I used 2 measures : 

  • Sea weight = CALCULATE(SUM(File1[Total Weight]), File1[Shipping type]=40)
  • Sea% = DIVIDE([Sea weight],[Total weight formula],BLANK())


Do you have an idea for the average of the % of maritime to appear next to the sum of the weight?


Thank you.




Super User
Super User
Community Support
Community Support

Hi @Anonymous,

You can take a look at the following link to use if statement with the filters to check current row context level and replace the calculation expressions:

Clever Hierarchy Handling in DAX - SQLBI


Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Super User
Super User

Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors