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
maciekimirekk
Frequent Visitor

Matrix issue

Dear all,

I have the following question. I have three matrices:

  1. Values for each country/month

  2. Calculation of the difference between the First month and Last month

  3. I have attempted to combine them together; however, in the results, I have values for each month separately. The desired outcome is to have them in one column at the end (1+2). Is it possible to achieve this? If so, how? Perhaps some adjustments in the formula are needed?

    maciekimirekk_0-1707046406871.png

     

     

     

     

    Thanks!

1 ACCEPTED SOLUTION

@maciekimirekk , You can use isinscope and replace grand total with value you need

 

Assume you are using measure m1

 

Max Month Value =
var _max = Maxx(allselected(Date), Date[Date])
var _min = eomonoth(_max, -1)+1

return
calculate([M1], Filter(Date,Date[Date] <=_max && Date[Date] >=_min) )


Min Month Value =
var _min = Minx(allselected(Date), Date[Date])
var _max = eomonoth(_max, 0)

return
calculate([M2], Filter(Date,Date[Date] <=_max && Date[Date] >=_min) )


Variance = [Max Month Value] - [Min Month Value]

 

Final Measure = if(isinscope(Date[Month Year]), [M1], [Variance])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
sayaliredij
Solution Sage
Solution Sage

Hi @maciekimirekk 

 

Could you write briefly what output you are expecting?

It was not clear to me from description

Pehaps you can post how your result look like

 

Thanks and Regards,

 

Sayali

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @sayaliredij 

The expected results is to have the values shown in one matrix as a combination of Matrix no.1 + Matrix no.2. The current output is visible in the Matrix 3, however, values are repated for each month and I would like to have it visible only once at the end of table. (As 5th column in this case). So simply, merge Matrix 1+2.

Hope it's clear.

@sayaliredij 

I achived that by adding the measure for the each separate month, however, is there any way to do that without adding separate measrue for each month? So on the left is the expected outcome, however, I am using measures there. On the right there are no measures, thus each month is displayed twice.

 

maciekimirekk_0-1707056562959.png

 

 

Thanks!

@maciekimirekk , You can use isinscope and replace grand total with value you need

 

Assume you are using measure m1

 

Max Month Value =
var _max = Maxx(allselected(Date), Date[Date])
var _min = eomonoth(_max, -1)+1

return
calculate([M1], Filter(Date,Date[Date] <=_max && Date[Date] >=_min) )


Min Month Value =
var _min = Minx(allselected(Date), Date[Date])
var _max = eomonoth(_max, 0)

return
calculate([M2], Filter(Date,Date[Date] <=_max && Date[Date] >=_min) )


Variance = [Max Month Value] - [Min Month Value]

 

Final Measure = if(isinscope(Date[Month Year]), [M1], [Variance])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors