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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Arkhos94
Helper IV
Helper IV

Table : how to includes gap with year N-1

I have a database looking roughly like this :

Account numberCategorySpending in €Year
    
    
    

 

Year can be : 2022, 2021, budget 2022

I have a measure summing the spending column for each category (category being things like gross profit, turnover...) => to make it simple, measure of category 1 is sum for category = category 1, measure of category 2 is sum for category = category 1 or 2, measure of category 3 is sum for category = category 1 or 2 or 3 (and so on)

 

I show this measure it in my report in a matrix like this :

 20212022Budget 2022
Category 1   
Category 2   
Category 3   

 

(year is in column, the measure for each category is in line, I checked the option "Show On rows" in the value/option)

 

Up to that => no issue. Problem : I have been asked to modify the report like this : 

 20212022Budget 2022Gap 2022 vs 2021 Gap 2022 vs budget 2022
Category 1     
Category 2     
Category 3     

I have not a single clue on how to do it. Create a measure to caculate the gap 2022/2021 and 2022/budget 2022 is easy with calculate

 

Problem is :

I don't have a clue on how to show these mesure as shown above

as each category have its own measure to calculate the sum of spending, calculate the gape with a measure will force me to create 2 new measure for each category AND update each of them each year

 

Any idea on how to do it ?

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Arkhos94 ,

 

What is the exact formula you created? Can you provide the relevant test data and describe it so that I can answer it for you as soon as possible.


Looking forward to your reply.


Best Regards,
Henry

 

Hello

 

The exact data look like this (with rougly 92k lines in the real base) :

Spending €YearAccount number
1002022201220
3002021301210
1202021201220
2002022 budget301210
1502022 budget201220
3502022301210

 

This table is connected to a second table (with over 3000 accounts number in the real base) :

Account numberCategory
2012202 - Gross profit
3012101 - Turnover

 

Measures are like this

Turnover = calculate(sum([Spending €]),[category]="1-Turnover")

Gross profit= calculate(sum([Spending €]),[category]="2-Gross Profit")+[Turnover]

I stopped with 2 category but there are 3 more : margin, contribution and then net result. Margin sum category 3 then add Gross profit, Contribution sum category 4 then add margin, net result sum category 5 then add contribution

 

There are then many more measures (maybe 2 dozen, for financial analysis) like calculating Gross Profit in % by dividing Gross profit with Turnover. 

 

I cannot give the real data as it is the financial results and mapping of my company 

But the tables and measure are the correct one

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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