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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
admin_xlsior
Post Prodigy
Post Prodigy

Budget Allocation without relationship

Hi,

 

I'm wondering can we calculate Budget, without relationship ?

 

For example I have this table

DealerRegionBranchYearMonthWO groupBudget
DEMFWashington RegWashingtonCalendar 2019January 2019External160.00
DEMFWashington RegWashingtonCalendar 2019February 2019External220.00
DEMFWashington RegWashingtonCalendar 2019March 2019External180.00
DEMFWashington RegWashingtonCalendar 2019April 2019External100.00
DEMFWashington RegWashingtonCalendar 2019January 2019Internal160.00
DEMFWashington RegWashingtonCalendar 2019February 2019Internal220.00
DEMFWashington RegWashingtonCalendar 2019March 2019Internal180.00
DEMFWashington RegWashingtonCalendar 2019April 2019Internal200.00
DEMFWashington RegWashingtonCalendar 2019January 2019Warranty160.00
DEMFWashington RegWashingtonCalendar 2019February 2019Warranty220.00
DEMFWashington RegWashingtonCalendar 2019March 2019Warranty220.00
DEMFWashington RegWashingtonCalendar 2019April 2019Warranty260.00
DEMFCalifornia RegCaliforniaCalendar 2019January 2019External160.00
DEMFCalifornia RegCaliforniaCalendar 2019February 2019External220.00
DEMFCalifornia RegCaliforniaCalendar 2019March 2019External180.00
DEMFCalifornia RegCaliforniaCalendar 2019April 2019External160.00
DEMFCalifornia RegCaliforniaCalendar 2019January 2019Internal120.00
DEMFCalifornia RegCaliforniaCalendar 2019February 2019Internal200.00
DEMFCalifornia RegCaliforniaCalendar 2019March 2019Internal100.00
DEMFCalifornia RegCaliforniaCalendar 2019April 2019Internal80.00
DEMFCalifornia RegCaliforniaCalendar 2019January 2019Warranty160.00
DEMFCalifornia RegCaliforniaCalendar 2019February 2019Warranty220.00
DEMFCalifornia RegCaliforniaCalendar 2019March 2019Warranty280.00
DEMFCalifornia RegCaliforniaCalendar 2019April 2019Warranty160.00

Then I created this measures :

Budget Allocation =
    VAR CurrentMonth = SELECTEDVALUE('Date'[Month])
    VAR MonthlyBudgetAmt = CALCULATE([Total Budget-GP], FILTER( ALL('Budget' [Month]), CurrentMonth = 'Budget'[Month]
    )
    )
return MonthlyBudgetAmt

 

This is return correct value :

Month     Budget
January 2019920
February 20191300
March 20191140
April 2019960

 

However I wan to add the other filter like Region and Branch. The slicer, and also the table visualization might need to display those value as well.

 

So at first I tried to add the region frst like this :

Budget Allocation =
    VAR CurrentMonth = SELECTEDVALUE('Date'[Month])
    VAR CurrentRegion = SELECTEDVALUE('Region'[Region])
    VAR MonthlyBudgetAmt = CALCULATE([Total Budget-GP], FILTER( ALL('Budget' [Month]), CurrentMonth = 'Budget'[Month],
FILTER( ALL('Budget' [Region]), CurrentRegion = 'Budget'[Region]
    )
    )
return MonthlyBudgetAmt

 

It just give me blank value.

 

Thanks,

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @admin_xlsior 

You may try below measure or just use budget table's region column as slicer.For further,please refer to attached sample file.

Measure =
VAR CurrentMonth =
    SELECTEDVALUE ( 'Date'[Month] )
VAR CurrentRegion =
    SELECTEDVALUE ( 'Region'[Region] )
VAR MonthlyBudgetAmt =
    CALCULATE (
        [Total Budget-GP],
        FILTER (
            ALL ( 'Budget' ),
            CurrentMonth = 'Budget'[Month]
                && CurrentRegion = 'Budget'[Region]
        )
    )
RETURN
    MonthlyBudgetAmt

Regards,

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

View solution in original post

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @admin_xlsior 

You may try below measure or just use budget table's region column as slicer.For further,please refer to attached sample file.

Measure =
VAR CurrentMonth =
    SELECTEDVALUE ( 'Date'[Month] )
VAR CurrentRegion =
    SELECTEDVALUE ( 'Region'[Region] )
VAR MonthlyBudgetAmt =
    CALCULATE (
        [Total Budget-GP],
        FILTER (
            ALL ( 'Budget' ),
            CurrentMonth = 'Budget'[Month]
                && CurrentRegion = 'Budget'[Region]
        )
    )
RETURN
    MonthlyBudgetAmt

Regards,

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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