March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear community,
I have many rows with start and finish dates. I want to project expenses(cost+salary) for future months. For instance, we are in november and I want to project expenses for december. The question is that I don't want to include any employee that its end date is less than 31/12/2024, becuse this date means that the employee not finish its relationship with the company.
I tried to create this measure, but the result is blank.
How can I do this?
Thanks to everybody.
José Luis
Solved! Go to Solution.
Hi @jlarques ,
To project expenses for a future month (e.g., December 2024) while excluding employees whose END DATE is earlier than 31/12/2024, you can modify your DAX measure as follows:
ProjectedExpenses = VAR _FechaFin = DATEVALUE("31/12/" & YEAR(TODAY())) VAR Result = CALCULATE( SUM(factPuestos[Cost]) + SUM(factPuestos[Salary]), FILTER( factPuestos, factPuestos[END DATE] >= _FechaFin ) ) RETURN Result
_FechaFin Calculation:
FILTER Logic:
Summation:
SUM vs. VALUES:
Let me know if you face further issues!
Please accept this as solution if it helps. Appreciate Kudos.
Thank you so much @FarhanJeelani !
your explanation contains important details to understand what was the problem. Now it works and I have my specific calculation for each employee.
Thanks again!
Hi @jlarques ,
To project expenses for a future month (e.g., December 2024) while excluding employees whose END DATE is earlier than 31/12/2024, you can modify your DAX measure as follows:
ProjectedExpenses = VAR _FechaFin = DATEVALUE("31/12/" & YEAR(TODAY())) VAR Result = CALCULATE( SUM(factPuestos[Cost]) + SUM(factPuestos[Salary]), FILTER( factPuestos, factPuestos[END DATE] >= _FechaFin ) ) RETURN Result
_FechaFin Calculation:
FILTER Logic:
Summation:
SUM vs. VALUES:
Let me know if you face further issues!
Please accept this as solution if it helps. Appreciate Kudos.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |