Forum Discussion

zubairs's avatar
zubairs
Icon for Helper I rankHelper I
4 years ago
Solved

Slicer selection - Cost allocation by department

Hi Guys,   I am creating a model where I have to allocate admin cost between two departments. So I have deparmtent mapping which allows me to create a slicer and look at the cost of each department...
  • v-yingjl's avatar
    4 years ago

    Hi zubairs ,

    You can create a measure like this to calculate:

    Re = 
    VAR _sum =
        CALCULATE ( SUM ( 'Table'[Values] ), 'Table'[Department] = "KSA Sales" )
            + 0.5
                * CALCULATE ( SUM ( 'Table'[Values] ), 'Table'[Department] = "KSA Branch Admin" )
    RETURN
        IF (
            HASONEVALUE ( 'Table'[CE mapping] ),
            [Last Year],
            IF ( HASONEFILTER ( 'Table'[Department] ), [Last Year], _sum )
        )

     

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