Forum Discussion

smiler2021's avatar
smiler2021
Regular Visitor
4 years ago
Solved

monthly split per category

Hi, can somebody help with the following issue:   I have a table of budget values for full year per product and I have a table of % split into months per product - splits are different per produc...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi smiler2021 ,

    Sorry for delay. I created a sample pbix file(see attachment) for you base on your provided sample data, please check whether that is what you want. You can create two measures as below to get the budget value per product and month:

    Measure = 
    VAR _selproduct =
        SELECTEDVALUE ( 'Budget'[Product] )
    VAR _selmonth =
        SELECTEDVALUE ( 'Split'[Month] )
    VAR _budget =
        CALCULATE (
            MAX ( 'Budget'[Budget] ),
            FILTER ( 'Budget', 'Budget'[Product] = _selproduct )
        )
    VAR _percentmonth =
        CALCULATE (
            MAX ( 'Split'[% of month] ),
            FILTER ( 'Split', 'Split'[Product] = _selproduct && 'Split'[Month] = _selmonth )
        )
    RETURN
        _percentmonth * _budget
    Budget value per product and month = 
    SUMX (
        VALUES ( 'Budget'[Product] ),
        SUMX ( VALUES ( 'Split'[Month] ), [Measure] )
    )

    If the above one is not your expected result, please provide more sample data with Text format and your expected result with more details(include calculation logic, special examples etct.). Thank you.

    Best Regards