Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello All
How to write expression in a dax to replace employee record historical vlaue with current value for department & role. In General when people change org or department or they get promoted these scenarios come across how do we handle them in expression.
1) if "Prior dept" column is blank or null or unmapped values then replace value from "Emp Dept" else Prior Dept
2) If Prior Role is blank or null value then replace value from Emp role else "Prior Role
Thanks
Vs
Solved! Go to Solution.
Hi @refint650 ,
Hope all is going well.
Please follow these steps:
1. This is the original data I created:
2. To achieve your needs, I created two calculated columns, the DAX syntax is as follows:
Calculated Dept =
IF('Table1'[Prior Dept] = blank() || [Prior Dept] = "unmapped",'Table1'[Emp Dept],'Table1'[Prior Dept])
Calculated Role=
IF('Table1'[Prior Role] = blank() || [Prior Role] = "unmapped",'Table1'[Emp Role],'Table1'[Prior Role])
3. Drag them to the report page for display. The effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @refint650 ,
Hope all is going well.
Please follow these steps:
1. This is the original data I created:
2. To achieve your needs, I created two calculated columns, the DAX syntax is as follows:
Calculated Dept =
IF('Table1'[Prior Dept] = blank() || [Prior Dept] = "unmapped",'Table1'[Emp Dept],'Table1'[Prior Dept])
Calculated Role=
IF('Table1'[Prior Role] = blank() || [Prior Role] = "unmapped",'Table1'[Emp Role],'Table1'[Prior Role])
3. Drag them to the report page for display. The effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
You cannot replace/modify column values with DAX. Best you can do is add another calculated column.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
54 | |
38 | |
29 |
User | Count |
---|---|
78 | |
62 | |
45 | |
40 | |
40 |