Manchester City right-back Cancelo had an exceptional season for the Premier League champions, and looked set to be a key player for Portugal as they aim to defend their European crown.
Indeed, he scored one and set up another as Portugal ended their preparations with a 4-0 friendly win over Israel on Wednesday.
However, the 27-year-old returned a positive test on Saturday and has now been placed into isolation. Further tests carried out across the rest of the squad revealed no more positive cases.
In accordance with UEFA's rules for the tournament, Portugal have replaced Cancelo with uncapped Manchester United defender Dalot, who spent last season on loan at Milan.
"Under-21 international Diogo Dalot will join the national team's delegation in Budapest to prepare for his debut at Euro 2020," a Portugal statement read.
"He will replace Joao Cancelo, who tested positive for COVID-19 following a rapid antigen test carried out this Saturday by the FPF Health and Performance Unit.
"The Hungarian health authorities were immediately informed and the player – who is doing well – was placed in isolation.
"The result of the test carried out by USP was confirmed by an RT-PCR test carried out on Joao Cancelo also on Saturday and whose result was known on Sunday morning.
"In accordance with the COVID-19 protocol defined by UEFA before the EURO 2020 matches, all players and members of the entourage underwent RT-PCR tests on Saturday. The results, with the exception of Joao Cancelo, were negative."
Fernando Santos' side start their campaign against Hungary on Tuesday, before taking on Germany four days later and rounding off their Group F fixtures against world champions France.