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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
EvaHello
Frequent Visitor

Income statement - wanting to include gross margin % row (doesnt need to be calculated)

Hi all,

 

I have some sample data for an income statement.  However in my matrix, i cant format the % lines easily.  They dont need to be a calculation as i have it in my source data but they need to be 'x%'

 

Ideally id like to add a % variance column as well

 

Im very new to power BI!

 

Level 1PeriodMTD ActualMTD FCMTD PY
Net RevenueAbsolute138.2135.5135.6
   Direct CostsAbsolute(85.8)(84.3)(85.5)
 Absolute   
Gross ProfitAbsolute52.451.250.1
Gross Profit MarginPercentage38%38%37%
EBIT MarginPercentage52%12%16%
1 ACCEPTED SOLUTION
v-sshirivolu
Community Support
Community Support

Hi @EvaHello ,
Thanks for reaching out to the Microsoft fabric community forum.

Create these Measures - 
Formatted MTD Actual Measure - 
Formatted MTD Actual =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD Actual])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Formatted MTD FC Measure - 
Formatted MTD FC =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD FC])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Formatted MTD PY Measure - 
Formatted MTD PY =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD PY])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Create % Variance Column (e.g., Actual vs FC)
% Variance Actual vs FC =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Actual = SELECTEDVALUE('YourTable'[MTD Actual])
VAR FC = SELECTEDVALUE('YourTable'[MTD FC])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Actual - FC, "0%"),
FORMAT(DIVIDE(Actual - FC, FC), "0.0%")
)

Create a Matrix Visual
Rows : Level 1
Values : Add all the measures created

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Sreeteja.
Community Support Team 

View solution in original post

6 REPLIES 6
v-sshirivolu
Community Support
Community Support

Hi @EvaHello ,
Thanks for reaching out to the Microsoft fabric community forum.

Create these Measures - 
Formatted MTD Actual Measure - 
Formatted MTD Actual =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD Actual])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Formatted MTD FC Measure - 
Formatted MTD FC =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD FC])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Formatted MTD PY Measure - 
Formatted MTD PY =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Val = SELECTEDVALUE('YourTable'[MTD PY])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Val, "0%"),
FORMAT(Val, "#,##0.0")
)

Create % Variance Column (e.g., Actual vs FC)
% Variance Actual vs FC =
VAR MetricType = SELECTEDVALUE('YourTable'[Period])
VAR Actual = SELECTEDVALUE('YourTable'[MTD Actual])
VAR FC = SELECTEDVALUE('YourTable'[MTD FC])
RETURN
IF(
MetricType = "Percentage",
FORMAT(Actual - FC, "0%"),
FORMAT(DIVIDE(Actual - FC, FC), "0.0%")
)

Create a Matrix Visual
Rows : Level 1
Values : Add all the measures created

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Sreeteja.
Community Support Team 

@v-sshirivolu could i ask one more thing, is there a way to format the % if negative to show as in brackets?

Hey @EvaHello ,

My response and screenshot has a different field name, but all you have to do is go to the data field and right click on it and then select "Conditional Formatting"

collinq_0-1750266723620.png



Then, choose Font Color.

Then, choose "rules":
And select the less than zero and greater than zero.  Since you have to do the red with a start and an end just put a bunch on "9" in there like I  have in this screenshot (the greater than for red is greater than -999999).

collinq_1-1750266942403.png

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




@SR You are an absolute genius!!!  Thank you so so so much!!!

collinq
Super User
Super User

HI @EvaHello ,

Welcome to the World of Power BI !!    I am not sure I am following the first issue - I am seeing the percentage in the column....is that in Power BI or is that in your sample?   If you are seeing that in the sample and not in Power BI, the solution is to format your field.  There are a few ways to do so but probably the easiest is to select the field on the right hand side of the report page:

collinq_0-1749759242090.png


And then, in the ribbon, select the format and select percentage:

collinq_1-1749759304248.png


In regards to your variance question - are you just needing to divide one field from the other, or are you trying to do something else when you say the word "variance"?

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




Aqua1
Frequent Visitor

@collinq Hi!  Thank you for replying.   So in my data, i have periods along the top, metrics on the left hand side.  So I guess the question is how do I format the rows which are margin related?  I want some numbers in the column to be absolute,  some to be margin related.

 

I haven't a clue how to write code to get margins, so ive calculated it all in my excel and imported everything across.  Please let me know if there's a better way

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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