Forum Discussion
Power BI subscrating Matrix view.
- 9 years ago
You may refer to the following measures.
Revenue = CALCULATE ( SUM ( Table1[Value] ), Table1[Cost_Center_2] = "Revenue" )
Costs = CALCULATE ( SUM ( Table1[Value] ), Table1[Cost_Center_2] = "B Project Costs" )
X = [Revenue] - [Costs]
Percent = DIVIDE ( [X], [Revenue] )
You may refer to the following measures.
Revenue = CALCULATE ( SUM ( Table1[Value] ), Table1[Cost_Center_2] = "Revenue" )
Costs = CALCULATE ( SUM ( Table1[Value] ), Table1[Cost_Center_2] = "B Project Costs" )
X = [Revenue] - [Costs]
Percent = DIVIDE ( [X], [Revenue] )
v-chuncz-msft, this also works fine but be aware that these Revenue & Cost measures will deliver the same value even for rows with, for example, Gross sales. As long as you don't put those together in a visual its ok and even shorter code. If you only want the Revenue to be calculated for the rows with the Revenue labels use the FILTER() clause.
The FILTER clause will only give the rows with Revenue as label to the calculation of SUM(Table1[Value]). So if there is a row for Revenue and Cost it will only calculates for one row.
Difference between Revenue with FILTER and without:
The totals are displayed correct but the € 100 at the Cost category is incorrect and can be misleading.
michalintive, choose your desired solution! The left one is described in v-chuncz-msft post, the right one in my post.
- michalintive9 years agoRegular Visitor
Hi all,
Thanks for all solutions. There is one more thing. Desktop PowerBI shows me now measures after each column:
Is there any way to show columns with measures only after Cost Center 2, in the way as below?
Much apriciate for your help!
- michalintive9 years agoRegular Visitor
Ok, problem solved, I hidden the columns :) Thank you all!!