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.
Hello All,
I am currently trying to create a burndown style of report that is slightly complicated using the switch statement and comparing dates.
What I am trying to achieve:
I have included an example excel file and an example PBI file. In the PBI file I have a few switch statements but the October statement is below so you can see an easy example without downloading anything. The switch statement below is not returning the expected value if the PO has already ended or has not started yet.
Hi @Anonymous,
A little complex of your sceanrio. What is your desired output? Your desired output will help me understand your scenario better.
In addition, your data sample have many columns, please note do not share any sensitive data in this forum. You could share the sample data which could reproduce the scenario. Simple data model will help use understand your scenario and logic more quickly.
Best Regards,
Cherry
Hi @v-piga-msft,
I appreciate the help ahead of time, I have been working on this issue for a little while now and I have been unable to figure it out.
Essentially my desired output would be dependent on each individual employee but ultimately if an employee was able to work in a given month it would use a set amount of workable hours unless they have submitted hours worked. If they have submitted hours worked it would use that over the default value. I will give a few examples below.
Emp 1: Start Date = 9/1/18 | End Date = 8/31/19
This employee's hours value for every month would be the number of workable hours unless they have submitted their hours.
So Sept Worked Hours = 48.
If(Sept Worked Hours > 0, Sept Worked Hours, 152)
Emp 2: Start Date = 9/1/18 | End Date = 1/31/19
This employee would have workable hours only from Sept to January, unless they submitted hours after January for some reason.
So Feb Worked Hours = 48.
If(Feb Worked Hours > 0, Feb Worked Hours, 0)
Employee 3 and 4 are similar to employee 2.
Emp 3: Start Date = 12/1/18 | End Date = 4/1/19
Emp 4: Start Date = 1/1/19 | End Date = 8/31/19
The issue I have been facing is due to the different start and end dates for each employee. This does not allow me to use a simple if or switch statement to solve the problem.
Aslo I appreciate the note about sensitive data, everything I have provided is dummy data that is to be used as sample data.
Best,
DataPepper
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |