cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

New Member

## Create Total by subgroup+ Difference + % using the new DAX function Window

Hello guys how are you?

Here is one example of my PBI (simple one, with sales by country per day)

I'm looking forward to (using the new DAX window function):

1. add a total by Continent per day
2. add the difference per continent per day

Example of the desired final result (in Excel)

Here are the:

• Excel used as Data Source (and the final result) - link

Really appreciate

Leo

2 REPLIES 2
Super User

Hi,

Please check the below picture and the attached pbix file, whether it works for you.

``````Sales: =
SUM( Tabela1[Sales] )``````

``````Diff: =
CALCULATE ( [Sales:], Tabela1[Group] = "Americas" )
- CALCULATE ( [Sales:], Tabela1[Group] = "Europe" )
``````

``````Percentage: =
DIVIDE( [Diff:], CALCULATE([Sales:], Tabela1[Group] = "Americas"))``````

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

New Member

Hello Kim, ty for the fast reply. I've done something similar to what you suggested. In 2 separated visuals, etc.

The issue is that sometimes we have more Countries per Region, and the tables do not fit well.

That's why I considered using the new window function (similar to Tableau table calculations). So, independent of how many countries the table shows, the final calculations would fit well in the same table)

TYVM

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors