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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Fatman121
Frequent Visitor

Matrix from unpivoted table - how use different methods of grandtotal calclulating

Hi!

I have unpivoted table like:

ProductMeasureUnitValue
Product 1PriceUSD1000
Product 1Remainstn10
Product 1Competitor PriceUSD1050
Product 2PriceUSD1060
Product 2Remainstn15
Product 2Competitor PriceUSD1100
Product 3PriceUSD1060
............

So, I use matrix for visualize this info. I can't use pivot table because of more then 50 measures.

But in grandtotals I need to calculate the sum for tn-values and average for price-values. 

Is there are the way to do this? Or I will be forced to use pivoted table and prescribe the calculation rule for each measure? 

 

I have already tried to pivot measure via their parent groups (remains and price), but this way make visualization unpretty and unreadable 

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hi @Fatman121 ,

Start by creating a measure for each logic:

Remains = SUM(Table[Value])
Price = AVERAGE(Table[Value])


Then create a final measure that switches between the other measures, depending on the value of your "Measure" column. 

Dynamic selection =
SWITCH( SELECTEDVALUE( Table[Measure] ) ,
"Price" , [Price] ,
"Remains" , [Remains]
)


When you use the "Measure" column as the row dimension you should get the different types of logic while only having to use the single "Dynamic selection" measure as the value in the matrix. 

Hope this helps!

Br, 
J


Connect on LinkedIn

View solution in original post

2 REPLIES 2
Fatman121
Frequent Visitor

@tex628  I am very grateful for your help!

tex628
Community Champion
Community Champion

Hi @Fatman121 ,

Start by creating a measure for each logic:

Remains = SUM(Table[Value])
Price = AVERAGE(Table[Value])


Then create a final measure that switches between the other measures, depending on the value of your "Measure" column. 

Dynamic selection =
SWITCH( SELECTEDVALUE( Table[Measure] ) ,
"Price" , [Price] ,
"Remains" , [Remains]
)


When you use the "Measure" column as the row dimension you should get the different types of logic while only having to use the single "Dynamic selection" measure as the value in the matrix. 

Hope this helps!

Br, 
J


Connect on LinkedIn

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.