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.
Hi all 🙂
I am trying to calculate the number of vacation dates my employees have. my problem is, that I need to only see the vacation they have planned from 1st of september 2020. I would like to create a ned coloumn in a table, where I currently have three columns: The name of the employee, their initials, and how many vacation days he/she has earned from September.
The next coloum should the be the sum of vacation which the employee have planned, or already been on (from septermer 1st 2020). I can't figure out how to create a DAX code, which allows me to sum the vacation days for the employees with the date filter.
I hope you lovely people can help me with this! 🙂 Thank you so much in advance
Solved! Go to Solution.
Hi, @Anonymous
You can try to create a calculated column as follows to filter your vacation
Column =
SUMX (
FILTER (
Vacation,
'Vacation'[Employee] = 'Table'[Employee]
&& Vacation[Date_Month] >= DATE ( 2020, 09, 01 )
),
Vacation[Vacation hour]
)
I am not clear about the structure of your timetable, so I made a simple example, hope it will work for you.
Best Regards,
Community Support Team _ Eason
@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
As sep last month you can use time intelligence and date table like given in the example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
Hi @amitchandak 🙂
I am not interesten in the last mtd, but from 1st of september 2020 to (forever).
I have my time registration in one table and my calculations in another (see below).
I would like the coloum Afholdt ferie (means Vacation which have already been held), to only show me the registred vacation from september and onwards. The table Ferie[Ferietimer] shows all the vacation from may 2019.
My end goal is to somwhow create a DAX code, where it only takes the vacation posted after the 1st of september 2020, and sum it in the table.
Hi, @Anonymous
You can try to create a calculated column as follows to filter your vacation
Column =
SUMX (
FILTER (
Vacation,
'Vacation'[Employee] = 'Table'[Employee]
&& Vacation[Date_Month] >= DATE ( 2020, 09, 01 )
),
Vacation[Vacation hour]
)
I am not clear about the structure of your timetable, so I made a simple example, hope it will work for you.
Best Regards,
Community Support Team _ Eason
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |