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

creating a new column in matrix base on a calculation from varying inputs

I currently have a matrix with stores in the rows, months in the columns, and number of customers in the values section. I'm looking to use a slicer to filter the months down to two months that would then effect a new column delta that would calculate the change in the two months chosen. For example: 

Andi_R_1-1719352546714.png

Currently I have Jan and Jun choosen as my two months with then a delta column calculating the change in customers between the two months, and I want to be able to alter which months are chosen that would also impact the delta column (ex. changing to the difference between Mar and May). Is this possible? Any other ideas for what to do instead? Thank you in advance for any help!

 

(My org does not allow sharing links outside of the organization so I can't share the pbix file, below is the original data. I started with this and then unpivoted all columns but Store)

Andi_R_0-1719352522648.png

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

I would personally not un-pivot the table, and have it in format: Store | Month | Value
My sample is below:

vicky__1-1719354121012.png

Then I'd create a new (disconnected) table for the compare month to use in your slicer. This way, you can have two single-select slicers for the month which gurantees that your user will actually select 2 months and not break your dax later.

vicky__0-1719353867698.png

Then i will create 3 measures:

Value in Original Table = SUM('Table'[Value])
and 
Value using Created Months Table = CALCULATE(SUM('Table'[Value]), 'Table'[Month] = SELECTEDVALUE(Months[Month]))
and 
Delta = [Value using Created Months Table] - [Value in Original Table]

Hope that helps

View solution in original post

3 REPLIES 3
Andi_R
Frequent Visitor

That worked! Thank you!

vicky_
Super User
Super User

I would personally not un-pivot the table, and have it in format: Store | Month | Value
My sample is below:

vicky__1-1719354121012.png

Then I'd create a new (disconnected) table for the compare month to use in your slicer. This way, you can have two single-select slicers for the month which gurantees that your user will actually select 2 months and not break your dax later.

vicky__0-1719353867698.png

Then i will create 3 measures:

Value in Original Table = SUM('Table'[Value])
and 
Value using Created Months Table = CALCULATE(SUM('Table'[Value]), 'Table'[Month] = SELECTEDVALUE(Months[Month]))
and 
Delta = [Value using Created Months Table] - [Value in Original Table]

Hope that helps

Andi_R
Frequent Visitor

When I added this to my test dashboard it worked perfectly, however when I added these measures and rewrote for my specific dashboard the "Value using Created Months Table" measure shows up as blank so "Delta" only returns one month's value, any ideas of how to fix this? Would the fact that my table is appended and merged effect the measure? Thanks!

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.

Top Solution Authors