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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ArquimedesP
Helper II
Helper II

Add columns to matrix visual with hierarchy DAX

Hi guys, I'm trying to add 3 new columns after  the total column at the end of a matrix visual but I haven't being able to get it right.

 

I have this tables:

 

Quarters (no conected table)                                  

 

ArquimedesP_0-1625691693117.png

 

VW_Depositos_Unicos (example):

 

ArquimedesP_2-1625691853440.png

 

And this is their connections:

 

 

ArquimedesP_4-1625691977567.png

 

I use this measure to get this matrix:

 

Importes_por_Quarters =
VAR Q1= SELECTEDVALUE(Quarters[Value],"I Trim")
VAR Q2= SELECTEDVALUE(Quarters[Value],"II Trim")
VAR Q3= SELECTEDVALUE(Quarters[Value],"III Trim")
VAR Q4= SELECTEDVALUE(Quarters[Value],"IV Trim")
VAR Q5= SELECTEDVALUE(Quarters[Value],"Total")
VAR _Q1= CALCULATE(SUM(VW_Depositos_Unicos[Importe]),VW_Depositos_Unicos[Trimestre_Vencimiento]="1Q")
VAR _Q2= CALCULATE(SUM(VW_Depositos_Unicos[Importe]),VW_Depositos_Unicos[Trimestre_Vencimiento]="2Q")
VAR _Q3= CALCULATE(SUM(VW_Depositos_Unicos[Importe]),VW_Depositos_Unicos[Trimestre_Vencimiento]="3Q")
VAR _Q4= CALCULATE(SUM(VW_Depositos_Unicos[Importe]),VW_Depositos_Unicos[Trimestre_Vencimiento]="4Q")
VAR _Q5= SUM(VW_Depositos_Unicos[Importe])
RETURN
IF(HASONEVALUE(Quarters[Value]),IF(Q1="I Trim",_Q1,IF(Q2="II Trim",_Q2,IF(Q3="III Trim",_Q3,IF(Q4="IV Trim",_Q4,_Q5)))),_Q5)
 
ArquimedesP_5-1625692112593.png

 

And this is my values:

 

ArquimedesP_6-1625692196694.png

 

How should I change the Measure to add columns and respect the Hierarchy??

 

Thanks.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

@ArquimedesP You cannot add columns after the totals.  You can remove the totals and create your own custom matrix 

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

@ArquimedesP You cannot add columns after the totals.  You can remove the totals and create your own custom matrix 

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.