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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
learner03
Post Partisan
Post Partisan

View in Matrix

How can I achieve below view in Matrix-

Current Month as a whole and underneath that 3 sub columns-totalorders, on-timeorders and % and similar with last 3 months and 6.

I am unable to get how to do the the current month as a whole on top of the 3 coloumns which are underneath it.

akapoor03_0-1646784915660.png

 

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @learner03 ,

 

First of all, the matrix table cannot edit the column name itself, so we need to create a table to contain the column name we need, like this one.

vchenwuzmsft_0-1646978874268.png

In the second step, create a new column in your calendar table that will be used to calculate how many months from today the date of this line of orders is. Via this code : DidffMonth = DATEDIFF([Date],TODAY(),MONTH)

vchenwuzmsft_1-1646979079691.png

Finally, create three measures, and let the filter context of the measure change with the names of the different columns. Please modify these following measures to suit your model.

Total order = 
VAR _S = SELECTEDVALUE(COLUMN_NAME[Value2])
RETURN 
CALCULATE(SUM(FactTable[Values]),'CALENDAR'[DidffMonth]<=_S)

On time orders = 
var _s = SELECTEDVALUE(COLUMN_NAME[Value2])
return
CALCULATE(COUNT(FactTable[Values]),'CALENDAR'[DidffMonth]<=_s)

% = DIVIDE([On time orders],[Total order] )

 

And the final result:

vchenwuzmsft_2-1646979318040.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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-chenwuz-msft
Community Support
Community Support

Hi @learner03 ,

 

First of all, the matrix table cannot edit the column name itself, so we need to create a table to contain the column name we need, like this one.

vchenwuzmsft_0-1646978874268.png

In the second step, create a new column in your calendar table that will be used to calculate how many months from today the date of this line of orders is. Via this code : DidffMonth = DATEDIFF([Date],TODAY(),MONTH)

vchenwuzmsft_1-1646979079691.png

Finally, create three measures, and let the filter context of the measure change with the names of the different columns. Please modify these following measures to suit your model.

Total order = 
VAR _S = SELECTEDVALUE(COLUMN_NAME[Value2])
RETURN 
CALCULATE(SUM(FactTable[Values]),'CALENDAR'[DidffMonth]<=_S)

On time orders = 
var _s = SELECTEDVALUE(COLUMN_NAME[Value2])
return
CALCULATE(COUNT(FactTable[Values]),'CALENDAR'[DidffMonth]<=_s)

% = DIVIDE([On time orders],[Total order] )

 

And the final result:

vchenwuzmsft_2-1646979318040.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.