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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

how to add calculate columns in dimension level in matrix visual

Hi, experts, I have a problem in display some measures, here is the data:

null_0-1671169239572.png

I swithed the rows into values in matrix:

null_1-1671169246479.png

 

but the visual should be like this, a summary of top 3 months should be added, and similiary the gap of sum(202201-202206)and sum(202207-202212) should be added in a column

so how to add such a summary value in rows of yearmonth column? Thank you.

null_2-1671169264087.png

5 REPLIES 5
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Anonymous
Not applicable

Thanks for your reminding, here is the sample data:

yearmonthval1val2val3
202201235
202202371

202203

329

202204

227

202205

223

202206

366

and here is the result should be displayed in matrix after swith the rows into values:

besides the yearmonth column, 2 other calculates column should be added, cal 1 is the summary of 202201, 202202,202203; cal 2is the summary of 202204, 202205,202206:

 202201202202202203202204202205202206cal1cal2

val1

23322387
val23722261210
val35197361516

 

here  is an (admittedly crude) poposal of how this could be achieved.  

 

Ideally you would want to rethink that, by introducing Quarters, for example.

Anonymous
Not applicable

Thank you, but the data in the file is not the same with the sample data because the the raw data val1, val2, val3 is columns rather the value of one column, so this method no quite solved my problem

 because the the raw data val1, val2, val3 is columns

 

You don't want that pattern.  Power BI wants long and narrow tables, and does not like dynamic column counts.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors