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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Marcin
Helper V
Helper V

Two years cycle

Hi,

 

I am looking for a solution. We have special budget let say 500 USD that is available for every employee since contract start date, the amount is restored after two years to new 500 USD. 

 

I wolud like to create a calculated column ( CurrentBudget)  for every user where Current budget will be calculated according to two years cycle. 

 

I have another table where all expences ( Amount, UserID, Date)  are reported and should be deducted from total amount of budget in each cycle of two years. 

 

Any advice ?

 

MArcin 

1 ACCEPTED SOLUTION

Hi @Marcin,

 

Please check out the demo in the attachment for details. I have added more data to test with. The formula is like below.

BudgetLeft =
VAR currentUser = [User]
VAR intervalTimes =
    INT ( DATEDIFF ( [StartDate], TODAY (), DAY ) / 365 / 2 )
VAR nearestDay =
    DATEADD ( 'Calendar'[Date], 2 * intervalTimes, YEAR )
RETURN
    500
        - CALCULATE (
            SUM ( Expense[Amount] ),
            FILTER (
                'Expense',
                'Expense'[Costdate] >= nearestDay
                    && 'Expense'[Costdate] <= TODAY ()
                    && 'Expense'[User] = currentUser
            )
        )

Two_years_cycle

 

Best Regards,

Dale

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

View solution in original post

6 REPLIES 6
Marcin
Helper V
Helper V

I wolud like to add calculated column in Users table to show current budget amount according to costs and users start date. 

 

I don't know how to share pbix file here so I put some data, 

 

User     Username   StartDate
User1   Adam          01.05.2018
User2   Paul             01.07.2018
User3   Jim              01.09.2018

 

User    Costdate          Amount   Description
User1   21.08.2018      300          Mouse
User1   22.08.2018      35            Book
User2   02.08.2018      150          Bag
User3   03.09.2018      250         Headphones

Hi @Marcin,

 

Please check out the demo in the attachment for details. I have added more data to test with. The formula is like below.

BudgetLeft =
VAR currentUser = [User]
VAR intervalTimes =
    INT ( DATEDIFF ( [StartDate], TODAY (), DAY ) / 365 / 2 )
VAR nearestDay =
    DATEADD ( 'Calendar'[Date], 2 * intervalTimes, YEAR )
RETURN
    500
        - CALCULATE (
            SUM ( Expense[Amount] ),
            FILTER (
                'Expense',
                'Expense'[Costdate] >= nearestDay
                    && 'Expense'[Costdate] <= TODAY ()
                    && 'Expense'[User] = currentUser
            )
        )

Two_years_cycle

 

Best Regards,

Dale

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

That works for me, thanks.

 

I have one question, why do we need Time table column Date for Dateadd function instead of using Startdate from Users ?

 

I can't create relationship between Users and my Time table, so had to create another Time table only for this solution. 

Hi @Marcin,

 

Because DATEADD is a time intelligence function which needs a full and continuous date column as its first parameter. Was there an error message that you can't create a relationship? 

 

Best Regards,

Dale

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

Hi,

 

the error was that multiple value was entered and one value was expected. Between Users and Time tables I have table with Events where working hours are reported, so that we could check events by User and by Time. 

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi MArcin,

 

Can you share a dummy pbix file, please? Would you like the calculated column to show the remaining budget?

 

Best Regards,

Dale

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.