Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have a table that show which employees are working today. And if the employee is out, it should show the replacement's name and job number. However I am not able to show the replacement's job number now.
I need some help.
Here is my sample pbix file. Thanks.
https://drive.google.com/file/d/1qOXRswGZD6u-ZBAphHOT16XDc9iVqUyK/view?usp=sharing
Solved! Go to Solution.
Hi @wpf_ ,
According to your requirements, I recreated a measure on the Dynamic Replacement you created. The judgment condition is to return the Job Number of the current row when the columns are the same, otherwise return the value of the Job Number corresponding to the Employee Name. The following results can be used as a reference:
Measure =
var M_Cur_Name = [Dynamic Replacement]
var cur_job_Number = MAX(Employee[Job Number])
var job_number = CALCULATE(MAX(Employee[Job Number]), FILTER(ALL(Employee), Employee[Employee Name]= M_Cur_Name))
return
IF(M_Cur_Name = MAX(Employee[Employee Name]),cur_job_Number,job_number)
If the problem is still not resolved, please provide detailed error information and test data. Let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
According to your requirements, I recreated a measure on the Dynamic Replacement you created. The judgment condition is to return the Job Number of the current row when the columns are the same, otherwise return the value of the Job Number corresponding to the Employee Name. The following results can be used as a reference:
Measure =
var M_Cur_Name = [Dynamic Replacement]
var cur_job_Number = MAX(Employee[Job Number])
var job_number = CALCULATE(MAX(Employee[Job Number]), FILTER(ALL(Employee), Employee[Employee Name]= M_Cur_Name))
return
IF(M_Cur_Name = MAX(Employee[Employee Name]),cur_job_Number,job_number)
If the problem is still not resolved, please provide detailed error information and test data. Let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-henryk-mstf Thanks. I was able to get what I wanted. I am having a better understanding now. And thanks for your example.
Hi @wpf_ ,
According to your requirements, I recreated a measure on the Dynamic Replacement you created. The judgment condition is to return the Job Number of the current row when the columns are the same, otherwise return the value of the Job Number corresponding to the Employee Name. The following results can be used as a reference:
Measure =
var M_Cur_Name = [Dynamic Replacement]
var cur_job_Number = MAX(Employee[Job Number])
var job_number = CALCULATE(MAX(Employee[Job Number]), FILTER(ALL(Employee), Employee[Employee Name]= M_Cur_Name))
return
IF(M_Cur_Name = MAX(Employee[Employee Name]),cur_job_Number,job_number)
If the problem is still not resolved, please provide detailed error information and test data. Let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have two tables: employee and replacement. in the table visual i have the employee job position in one column, then i have a measure that gives me the respective empoyee name tied to that job position. The employee name changes to his replacement if the employee is out for that day. Now I want a third column that shows the employee's ID but based on which employee is in (based on that measure). How do you write a measure or calculated column based on which employee is listed for each row from the measure?
Here is the table structure:
employee: job position, employee name, employee ID
replacement: measure (to determine who is out, and who the replacement is).
Thanks
@wpf_ can you simply paste a sample data and expected output, or throw something in excel and share it thru one drive/google drive.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Here is the pbix file. Thank you so much for helping. So i basically want to show the job number for who ever is in the replacements column. Here is the pbix file: https://drive.google.com/file/d/1qOXRswGZD6u-ZBAphHOT16XDc9iVqUyK/view?usp=sharing
@wpf_ could you share sample data and expected output.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @wpf_ ,
According to your requirements, I recreated a measure on the Dynamic Replacement you created. The judgment condition is to return the Job Number of the current row when the columns are the same, otherwise return the value of the Job Number corresponding to the Employee Name. The following results can be used as a reference:
Measure =
var M_Cur_Name = [Dynamic Replacement]
var cur_job_Number = MAX(Employee[Job Number])
var job_number = CALCULATE(MAX(Employee[Job Number]), FILTER(ALL(Employee), Employee[Employee Name]= M_Cur_Name))
return
IF(M_Cur_Name = MAX(Employee[Employee Name]),cur_job_Number,job_number)
Here is the sample pbix file for reference.
If the problem is still not resolved, please provide detailed error information and let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @wpf_
If Jack replaced Lisa, won't lisa job number be assigned to Jack, i.e., 22222 and you would just need to use the 2nd column from your screenshot.
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@pranit828 @The job number stays with the employees. Lisa will keep 2222 and jack will keep 7777. I just want to show that if Lisa is out jack will take his place and his job number is 7777
HI @wpf_
So, Jack will have same job number eventhough he is tied to different Location (B and G)
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
72 | |
65 | |
46 |