Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kartiklal70
Frequent Visitor

Conditional Column Based on Multiple Conditions

Hi All, 

 

I have a CSR (Customer Search Ring) Table that is joined to a Milestones Table.  These two tables are joined on the CSR field. The data in the CSR table is as below: 

 

kartiklal70_0-1671637971300.png

 

The data in the Milestones Table is as below:

kartiklal70_1-1671637971444.png

 

 

Here's what I'd like to implement:

 

If Primary CSR YN = "No", then for that CSR, I'd like to get the Name, Actual Date and Forecast Date from it's corresponding Primary CSR for only Related Records "Site" and "SR".

 

For example, for CSR-1969, it's Name, Actual Date and Forecast Date in the Milestones table should be equal to that of CSR-0005 for Related Records "Site" and "SR". 

 

The issue is that when a CSR is NOT the Primary CSR, then its milestones will only have "CSR" Related Records. 

kartiklal70_2-1671637971812.png

 

 

I'm not sure what the best solution for this would be. Would a Conditional Column in Power Query be possible or is it possible to achieve this via DAX? 

2 REPLIES 2
Anonymous
Not applicable

Hi @kartiklal70 ,

 

Not sure, please try:

 

Measure = 
VAR _CSR = 
CALCULATETABLE(
    VALUES('CSR Table'[CSR]),
    'CSR Table'[Primary CSR YN] = "No"
)
VAR _result = 
IF(
    MAX('Milestones Table'[CSR]) IN _CSR
    && MAX('Milestones Table'[Related Record]) IN {"Site","SR"},
    1
)
RETURN
_result

 

If I have misunderstood your requirements, please share the simplified example data and expected output.

 

Best Regards,
Gao

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!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

Hi @Anonymous ,

 

I'm not sure a measure would work here. I've shared a link to a sample pbix that might help.

 

https://www.dropbox.com/s/jhwjngdqe5utnt9/Sample%20Report%20Updated.pbix?dl=0

 

Here, when you drillthrough for CSR-1747 you get the following milestones (only its CSR related records). 

 

kartiklal70_1-1671792817732.png

The Primary CSR for CSR-1747 is CSR-0007. When you drillthrough for CSR-0007 you get the following milestones (CSR, SR and Site Related Records)

 

kartiklal70_2-1671792977810.png

 

 

Now, for CSR-1747 (the non-primary CSR), I'd like to get it's Site and SR milestones from its corresponding primary CSR (CSR-0007). 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.