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
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
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.