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
wonkavator
New Member

Conditional column output based on value from one column and date difference from a second column

 
Hi,

 

I using power query and am trying to create a conditional column highlighted in the black square in the image. The conditional column would output "New" if there is no other row in the file where the value in the Drug and ID column is an exact match to the current row OR if the data does match, the date difference must 1 year or greater. The conditional column would output "Refill" if there is an exact match in the Drug and ID column AND date difference is within 1 year. The example provided shows the desired output. Hoping this is possible. Thanks in advance!

tempsnip.png

1 ACCEPTED SOLUTION
Jakinta
Solution Sage
Solution Sage

This might help.

Jakinta_0-1680821461775.png

Result:

Jakinta_1-1680821501377.png

 

 

View solution in original post

1 REPLY 1
Jakinta
Solution Sage
Solution Sage

This might help.

Jakinta_0-1680821461775.png

Result:

Jakinta_1-1680821501377.png

 

 

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.