Forum Discussion
Pratiksha1
4 years agoNew Member
Creating a dynamic calculated column
Hi all, I am new to PowerBI and I am facing a challenge with creating a calculated column that will get updated automatically as the dataset keeps getting filtered. My dataset looks like this -
I have created the Deliverable_Milestone_Match column using the formula -
Deliverable_Milestone_Match = if(Sheet1[Issue_Type] = "CO Deliverable", VAR _sel = SELECTCOLUMNS(Sheet1, "MilestoneIssueKey", [Issue_Key]) RETURN IF( Sheet1[MilestoneIssueKey] IN _sel, "MAPPED","UNMAPPED"),"MILESTONE")
Now, the challenge is, I will need to apply some filters on this dataset, and since my calculated column references other columns in the data, it also needs to change accordingly. For example: The formula is looking up the presence of MilestoneIssueKey in Issue_Key, and it is populating MAPPED if it gets a match, and UNMAPPED otherwise. Now, if I apply a filter that removes a specific unique Issue_Key, then the corresponding MilestoneIssueKey won't have a match anymore, and the Deliverable_Milestone_Match value should change to UNMAPPED now.
I would really appreciate if anyone can help me on this. I am not even sure if this can be achieved via DAX or whether I will need to use Power Query for this.
Thanks in advance!
Now, the challenge is, I will need to apply some filters on this dataset, and since my calculated column references other columns in the data, it also needs to change accordingly. For example: The formula is looking up the presence of MilestoneIssueKey in Issue_Key, and it is populating MAPPED if it gets a match, and UNMAPPED otherwise. Now, if I apply a filter that removes a specific unique Issue_Key, then the corresponding MilestoneIssueKey won't have a match anymore, and the Deliverable_Milestone_Match value should change to UNMAPPED now.
I would really appreciate if anyone can help me on this. I am not even sure if this can be achieved via DAX or whether I will need to use Power Query for this.
Thanks in advance!
2 Replies
- Hariharan_RSolution Sage
Hi Pratiksha1
If you need to handle the dynamic filters for your logic then create measures instead of calculated columns.
Thanks
Hari
Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.
My Blog :: YouTube Channel :: My Linkedin- Pratiksha1New Member
Hey thanks for your response! But I will need to make columns only. Is there any way to perform the task by creating columns?