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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ww2020
New Member

Pivot with multiple tables / Waterfall chart

I have a number of questions when I put Power BI in use of my daily business. Luckily, most could be addressed in the previous community discussions. However, I still got the remaining issues as below.

 

Case 1:

I want to create a waterfall chart for each segment to illustrate the movements for the budget, variance (actual-budget) and actual.

 

For example, the expected chart for segment A:

Customer ActualBudgetDifference
Customer A10100-90
Customer B20100-80
Total30200 

jnAgNIp

Green is Budget, Red is variance, Blue is Actual

 


Raw data:

SegmentCustomer SalesPeriod
Segment ACustomer A10Actual
Segment ACustomer B20Actual
Segment BCustomer C20Actual
Segment BCustomer D30Actual
Segment CCustomer B30Actual
Segment CCustomer C40Actual
Segment DCustomer D40Actual
Segment DCustomer A50Actual
Segment ACustomer A100Budget
Segment ACustomer B100Budget
Segment BCustomer C50Budget
Segment BCustomer D50Budget
Segment CCustomer B25Budget
Segment CCustomer C25Budget
Segment DCustomer D200Budget
Segment DCustomer A200Budget

 

In query editor, I use 'Pivot Column' and add a column to sort as below:

 

 

= Table.AddColumn(#"Pivoted Column", "Difference", each [Actual]-[Budget])

 

 

 

SegmentCustomer ActualBudgetDifference
Segment ACustomer A10100-90
Segment ACustomer B20100-80
Segment BCustomer C2050-30
Segment BCustomer D3050-20
Segment CCustomer B30255
Segment CCustomer C402515
Segment DCustomer A50200-150
Segment DCustomer D40200-160

 

**Questions:

But then how can I add up sub-total for each segment's budget and actual total and store under column 'Difference' so that I can create a waterfall chart with category 'Customer' and Y axis 'Difference' with filter 'Segment'? What is the quickest way to show the four charts?

 

**Questions:

Many posts have already mentioned the needs of starting value (e.g. Budget) and ending value (e.g. Actual) in the waterfall chart, but not the fixed name 'Total' shown always in the chart. However, it seems currently no free way/feature to get this in MS Power BI. Please correct me if I am wrong.

 

Case 2:

Table 'Actual' :

CategoryActualRegionSegment
Category A10ISegment A
Category A20IISegment A
Category B30ISegment B
Category C30IISegment B
Category D40ISegment C
Category D50IISegment C

 

and Table 'Budget':

CategoryBudgetRegionSegment
Category A100ISegment A
Category A100IISegment A
Category B50IIISegment B
Category B50ISegment B
Category C25IISegment C
Category C25IIISegment C
Category D200ISegment D
Category D200IISegment D

 

Table visualization below works If I match the two tables column[Segment] into the relationship (many-to-many).

**Question: How to correct the total amount under category [Budget] as 700 includes Segment D
8ukT7Xh

However, if the relationship changes: Link Region to Region (many-to-many), then the table cannot function normally.

2nfG7Z0

 

But if I change from Region to region, then it works.

iKLTiCc

 

**Question:

Without unique identifier, the visualisation is easy to generate wrong figures, especially when I need to input a number of tables (and most belong to many-to-many relationships). However, in MS excel I can simply use sumif function to get the figures from different excel tabs. Do I miss anything? How can I solve it without creating any unique identifier?

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @ww2020 ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @ww2020 ,

 

Case1, For the first question, we cannot create four charts by one step, we can duplicate one into four and change the visual filter Segment to differnt value of them.

 

For the second question, we did not understand your requirement clearly, do you want that the blue total bar always show in the chart?

 

Case2, We suggest to create a dim table such as following :

 

Segment = Distinct(Union(Distinct('Budget'[Segment]),Distinct('Actual'[Segment])))

 

Regions = Distinct(Union(Distinct('Budget'[Region]),Distinct('Actual'[Region])))

 

Then we can create relationship between the dim table and fact table with one to many.

 

But if you do not want to create a table with unique value, we can also use the measure to meet your requirement:

 

Actual Measure =
CALCULATE (
    SUM ( 'Actual'[Actual] ),
    FILTER (
        ALLSELECTED ( 'Actual' ),
        'Actual'[Segment] IN FILTERS ( 'Actual'[Segment] )
            && 'Actual'[Segment] IN FILTERS ( 'Budget'[Segment] )
            && 'Actual'[Region] IN FILTERS ( 'Actual'[Region] )
            && 'Actual'[Region] IN FILTERS ( 'Budget'[Region] )
    )
)

 

Budget Measure =
CALCULATE (
    SUM ( 'Budget'[Budget] ),
    FILTER (
        ALLSELECTED ( 'Budget' ),
        'Budget'[Segment] IN FILTERS ( 'Actual'[Segment] )
            && 'Budget'[Segment] IN FILTERS ( 'Budget'[Segment] )
            && 'Budget'[Region] IN FILTERS ( 'Actual'[Region] )
            && 'Budget'[Region] IN FILTERS ( 'Budget'[Region] )
    )
)

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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