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
Adavin
Regular Visitor

Subtraction calulation

Hello,

 

I have an issue when trying to subtract from a group code data item 

Adavin_0-1779183744302.png

any help greatly appreciated

ADavin

1 ACCEPTED SOLUTION
v-anbandari
Community Support
Community Support

Hi @Adavin,
Thank you for posting your query in the Microsoft Fabric Community Forum.

I was able to reproduce your scenario in Power BI Desktop using my sample data.

Using sample grouped data for Income, Pay, Non Pay, and Subs, I created DAX measures to calculate:

  • Individual grouped totals
  • Overall Operation Total
  • Income % against the Operation Total

The calculation returned the expected result successfully.

vanbandari_0-1779434862782.jpeg

The percentage calculation was achieved using a DAX measure similar to:

Income % =
DIVIDE(
   [Income Total],
   [Operation Total],
   0
)

This approach works because the grouped labels (Income, Pay, Non Pay, etc.) are aggregated categories, so the calculation should be handled through measures rather than direct subtraction/division on grouped rows.

For your reference, I am also attaching the sample .pbix file used to reproduce the scenario.

Hope this helps.

View solution in original post

5 REPLIES 5
v-anbandari
Community Support
Community Support

Hi @Adavin,
Thank you for posting your query in the Microsoft Fabric Community Forum.

I was able to reproduce your scenario in Power BI Desktop using my sample data.

Using sample grouped data for Income, Pay, Non Pay, and Subs, I created DAX measures to calculate:

  • Individual grouped totals
  • Overall Operation Total
  • Income % against the Operation Total

The calculation returned the expected result successfully.

vanbandari_0-1779434862782.jpeg

The percentage calculation was achieved using a DAX measure similar to:

Income % =
DIVIDE(
   [Income Total],
   [Operation Total],
   0
)

This approach works because the grouped labels (Income, Pay, Non Pay, etc.) are aggregated categories, so the calculation should be handled through measures rather than direct subtraction/division on grouped rows.

For your reference, I am also attaching the sample .pbix file used to reproduce the scenario.

Hope this helps.

Adavin
Regular Visitor

Hi,

Hopefully this expalins a little better.

 

Task to find out what the actual is for Income, Pay, Non Pay and so on

Using the data item [Codes] that contain individual codes .i.e 1001, 1002

To find out what codes relate Income I have grouped them and called the grouping 'INCOME'

I have them created groups for Pay, Non Pay etc with the related codes for each. Then added [Actual] to get a total for each.

 

Adavin_0-1779205279490.png

You can see that the operation is a total of all Income, Pay, NON Pay and subs. I now need to take the Income/Operation and show as a %

...leider wird die Sache nicht klarer.

Willst Du die Ergebnisse nach den Codes aufsplitten? Wo kommen denn die Codes her? Aus einer anderen Tabelle? Dann musst Du eine Beziehung herstellen, einen Join bilden und kannst dann nach den Codes Gruppieren lassen.

ralf_anton
Resolver I
Resolver I

Hi,

 

wenn ich Dich richtig verstehe, möchtest Du wissen, wieviel % das Einkommen im Verhältnis zum operativen Ergebnis ergibt? 

= Income/Operation * 100

lbendlin
Super User
Super User

Welcome to the forums.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
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.

Top Solution Authors