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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Auto_queen
Helper I
Helper I

dax formula to allocate income to future dates

I'm having a difficult time with this and I don't know why. At the beginning of each year people get awarded units. They vest over 4 years starting the next year, 25%/year. I want to be able to show in a matrix table the amount of units vested per year even in the future, and I'm having trouble. 
I've added two calculated columns for Vesting Start Date and Vesting End Date. I've connected my table to a Date table. Nothing is working. 

Here is an example of my table: 

Grant IDGrant DateUserUnits Awarded
11/1/2020User12500
21/1/2021User15000
31/1/2022User18000
11/1/2020User21000
21/1/2021User22500

 

Here is an example of what I want to see: Filtered by User1

Grant ID202120222023202420252026
1625625625625  
2 1250125012501250 
3  2000200020002000


I tried this formula in addition to others but nothing is working. 

Vested Units =
VAR _year1 = DATEADD('User Units'[Grant Date],1,YEAR)
VAR _year4 = DATEADD('User Units'[Grant Date],4,YEAR)
VAR _vestedunits = [Total Units Awarded] *.25
RETURN
IF(SELECTEDVALUE(Table1[Vesting Dates].[Date]) >= _year1 || SELECTEDVALUE(Table1[Vesting Dates].[Date]) <= _year4, [Total Units Awarded]*.25,"")
2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file if it suits your requirement.

Jihwan_Kim_2-1702958076840.png

 

 

Jihwan_Kim_1-1702958064390.png

 

 

expected result measure: =
SUMX (
    CROSSJOIN (
        SUMMARIZE ( 'User Units', 'User'[User], 'User Units'[Grant ID] ),
        VALUES ( 'Calendar'[Year] )
    ),
    CALCULATE (
        VAR _awardtyear =
            YEAR ( MAX ( 'User Units'[Grant Date] ) )
        VAR _startyear = _awardtyear + 1
        VAR _finishyear = _awardtyear + 4
        VAR _award =
            SUM ( 'User Units'[Units Awarded] )
        VAR _25percent = _award / 4
        RETURN
            IF (
                MAX ( 'Calendar'[Year] ) >= _startyear
                    && MAX ( 'Calendar'[Year] ) <= _finishyear,
                _25percent
            )
    )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

Fowmy
Super User
Super User

@Auto_queen 

Please find below the allocation measure which also considers the Dates table relationship to filter the allocation years.

Allocation = 
var __years = VALUES(Dates[Year])
RETURN
CALCULATE(
    SUMX(
        ADDCOLUMNS(
            GENERATE(
                SUMMARIZE( Table1 , Table1[User] , Table1[Grant ID] , Table1[Grant Date]),
                  FILTER( GENERATESERIES( YEAR( Table1[Grant Date])+1 , YEAR( Table1[Grant Date])+4  ), [Value] in __years )
            ),
            "Amount",DIVIDE( CALCULATE(SUM(Table1[Units Awarded])), 4 )
        ),
        [Amount]
    ),
    REMOVEFILTERS(Dates)
)

Fowmy_0-1702979246513.png

File attached below.

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Auto_queen
Helper I
Helper I

Thank you so much! Both ways worked! I learned a lot from your work. Thank you! 

Fowmy
Super User
Super User

@Auto_queen 

Please find below the allocation measure which also considers the Dates table relationship to filter the allocation years.

Allocation = 
var __years = VALUES(Dates[Year])
RETURN
CALCULATE(
    SUMX(
        ADDCOLUMNS(
            GENERATE(
                SUMMARIZE( Table1 , Table1[User] , Table1[Grant ID] , Table1[Grant Date]),
                  FILTER( GENERATESERIES( YEAR( Table1[Grant Date])+1 , YEAR( Table1[Grant Date])+4  ), [Value] in __years )
            ),
            "Amount",DIVIDE( CALCULATE(SUM(Table1[Units Awarded])), 4 )
        ),
        [Amount]
    ),
    REMOVEFILTERS(Dates)
)

Fowmy_0-1702979246513.png

File attached below.

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file if it suits your requirement.

Jihwan_Kim_2-1702958076840.png

 

 

Jihwan_Kim_1-1702958064390.png

 

 

expected result measure: =
SUMX (
    CROSSJOIN (
        SUMMARIZE ( 'User Units', 'User'[User], 'User Units'[Grant ID] ),
        VALUES ( 'Calendar'[Year] )
    ),
    CALCULATE (
        VAR _awardtyear =
            YEAR ( MAX ( 'User Units'[Grant Date] ) )
        VAR _startyear = _awardtyear + 1
        VAR _finishyear = _awardtyear + 4
        VAR _award =
            SUM ( 'User Units'[Units Awarded] )
        VAR _25percent = _award / 4
        RETURN
            IF (
                MAX ( 'Calendar'[Year] ) >= _startyear
                    && MAX ( 'Calendar'[Year] ) <= _finishyear,
                _25percent
            )
    )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.