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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GeorgiBarov
Frequent Visitor

Year-to-date per category

Hi guys,

 

I have to create Year-to-date measure to recieve the bonus of every emloyee

Let me explain in the example.

This is my table and I want to get summurized information about year-to-date bonuses

 

Capture.PNG

 

So in the end I want to recieve this:

 

Capture1.PNG

1 ACCEPTED SOLUTION

HI @GeorgiBarov

 

Please try this...revision

 

YTD Bonus =
CALCULATE (
    SUM ( Table1[Bonus] ),
    FILTER (
        ALLEXCEPT ( Table1, Table1[Employee] ),
        Table1[Bonus Date] <= SELECTEDVALUE ( Table1[Bonus Date] )
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

HI @GeorgiBarov

 

Try this MEASURE

 

YTD Bonus =
CALCULATE (
    SUM ( Table1[Bonus] ),
    FILTER (
        ALL ( Table1[Bonus Date] ),
        Table1[Bonus Date] <= SELECTEDVALUE ( Table1[Bonus Date] )
    )
)

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad and thank you for the reply 🙂

I tried it and it works with the simple example which I gave, but when I tried it to use it in more complex dataset I recieved this:Capture2.PNG

And here is the data set and formula:

3.PNG

 

Have you got any suggestions why this happened? 

Thank you in advance 🙂

 

HI @GeorgiBarov

 

Please try this...revision

 

YTD Bonus =
CALCULATE (
    SUM ( Table1[Bonus] ),
    FILTER (
        ALLEXCEPT ( Table1, Table1[Employee] ),
        Table1[Bonus Date] <= SELECTEDVALUE ( Table1[Bonus Date] )
    )
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.