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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lencepeda
Frequent Visitor

Calculate Sum Based on Multiple Criteria

 

I'm having some trouble calcuting Buget Revenue based on a filter from another column.  Please help.  Thank you

 

Currently, I have a table structured in this format:

 

Department  Commission   Fee1       Fee2

East                1,000               100       100

West               1,000               100       100

North             1,000                100       100

South              1,000                100      100

 

And existing Calculated Meassures

 

Revenue = SUMX(Table1, Table1[Commission] + Table1[Fee1] + Table1[Fee2])

RevenueLastYear = Calculate(Table1[Revenue], SAMEPERIODLASTYEAR (Datetable[Date]))

 

RevenueBudget = ?????????

 

Next, how do i calculate the Revenue Budget based on criteria from the Department column?

 

2% increase over same period last year for one department "East"

3% increase over same period last year for one department "West"

5% increase over same period last year for all other departments.

 

I am not sure if this should be present in a single measure or if i need to create a new budget table

 

Thanks again, any advice would be great.  

 

 

 

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @lencepeda

 

Try this MEASURE

 

Revenue Budget =
SUMX (
    Table1,
    VAR increase =
        IF (
            Table1[Department] = "East",
            1.02,
            IF ( Table1[Department] = "West", 1.03, 1.05 )
        )
    RETURN
        ( Table1[Commission] + Table1[Fee1]
            + Table1[Fee2] )
            * increase
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

HI @lencepeda

 

Try this MEASURE

 

Revenue Budget =
SUMX (
    Table1,
    VAR increase =
        IF (
            Table1[Department] = "East",
            1.02,
            IF ( Table1[Department] = "West", 1.03, 1.05 )
        )
    RETURN
        ( Table1[Commission] + Table1[Fee1]
            + Table1[Fee2] )
            * increase
)

Regards
Zubair

Please try my custom visuals

Zubair thank you so much for your reply.   I apologize for the extremely late response.  

 

This looks promising however the "RETURN" should be applied against LAST Years Revenue not this years.  

 

When i try to use REVENUE LAST YEAR i receive nothing.   No error No value.   Any thoughts?

 

Revenue Budget =
SUMX (
    Table1,
    VAR increase =
        IF (
            Table1[Department] = "East",
            1.02,
            IF ( Table1[Department] = "West", 1.03, 1.05 )
        )
    RETURN
        ( Table1[REVENUELASTYEAR] )
            * increase
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.