Forum Discussion
Creating a new row with IF query in DAX
- 7 years ago
Hi Anonymous
1. In Query Editor go to Transform > New Query > New Source > Blank Query,
2. Go to advanced editor and paste the code and rename the Query1 to ExpandMonths.
3. When in your staff data table go to Add Column > General > Invoke Custom Function.
4. Make sure you set everything as on the screenshot below.5. this will add new column "ExpandMonths", all you need to do now is click the two arrows an select expand to new rows.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
What happened to the sick leave data?
I've just given an example set of data. Once I know how to treat two tables I'm sure I can work out how to treat three.
- HotChilli7 years ago
Community Champion
You can link the tables on Employee Number in Relationship View.
Create a Measure to ensure the employees with no leave still show up
Emp leave = SUM(EmployeeLeave[Annual Leave]) + 0
Then pull the relevant fields on to a table visualisation
- Anonymous7 years agoNot applicable
Thanks but that's not what I'm looking for. I need to create a date-based table that logs all activity against the individual. The key is to have every staff member represented against every month they are active (time beween employee start date and employee end date).
- HotChilli7 years ago
Community Champion
Yes, that did go through my mind but the sample data doesn't seem to fit that requirement e.g. Janet Bloggs has leave in June and July 19 but has left in April 2018