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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
marcelodiashms
Frequent Visitor

Create a calculated row

Hi friends,

I need to create a calculated row called "Faturamento líquido" where faturamento bruto minus (-) impostos sobre faturamento to columns Previsto and Real. It's possible?

 

New_Row.JPG

 

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create sample data below:

1.png2.png

Please follow these steps:

1)Create a table like this:

3.png

And append it to categoria1 table like this:

4.png

2)After ‘Close&Apply’, create two measures to display the original table you provide:

5.png

Here are my measures:

Previsto = SUM(Table2[Previsto])

Real = SUM(Table2[Real])

 

3)Create two measures to calculate minus result to [Previsto] and [Real]:

Previsto-Minus

= FIXED(CALCULATE(Table1[Previsto],FILTER(ALLSELECTED('Table1'),Table1[id1]=1))-CALCULATE(Table1[Previsto],FILTER(ALLSELECTED('Table1'),Table1[id1]=2)),2)

Real-Minus

= FIXED(CALCULATE(Table1[Real],FILTER(ALLSELECTED('Table1'),Table1[id1]=1))- CALCULATE(Table1[Real],FILTER(ALLSELECTED('Table1'),Table1[id1]=2)),2)

 

4)Create two measures to display the result:

Previsto-Result

= IF(MAX(Table1[id1])=4 && HASONEVALUE('Table1'[id1]),[Previsto-Minus],[Previsto])

Real-Result

= IF(MAX(Table1[id1])=4 && HASONEVALUE('Table1'[id1]),[Real-Minus],[Real])

5)The result shows:

6.png

Here is my test pbix file.

pbix 

Best Regards,

Giotto Zhi

View solution in original post

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create sample data below:

1.png2.png

Please follow these steps:

1)Create a table like this:

3.png

And append it to categoria1 table like this:

4.png

2)After ‘Close&Apply’, create two measures to display the original table you provide:

5.png

Here are my measures:

Previsto = SUM(Table2[Previsto])

Real = SUM(Table2[Real])

 

3)Create two measures to calculate minus result to [Previsto] and [Real]:

Previsto-Minus

= FIXED(CALCULATE(Table1[Previsto],FILTER(ALLSELECTED('Table1'),Table1[id1]=1))-CALCULATE(Table1[Previsto],FILTER(ALLSELECTED('Table1'),Table1[id1]=2)),2)

Real-Minus

= FIXED(CALCULATE(Table1[Real],FILTER(ALLSELECTED('Table1'),Table1[id1]=1))- CALCULATE(Table1[Real],FILTER(ALLSELECTED('Table1'),Table1[id1]=2)),2)

 

4)Create two measures to display the result:

Previsto-Result

= IF(MAX(Table1[id1])=4 && HASONEVALUE('Table1'[id1]),[Previsto-Minus],[Previsto])

Real-Result

= IF(MAX(Table1[id1])=4 && HASONEVALUE('Table1'[id1]),[Real-Minus],[Real])

5)The result shows:

6.png

Here is my test pbix file.

pbix 

Best Regards,

Giotto Zhi

Hi,

 

Amazing! Thanks for your solution! 😉

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.