Forum Discussion
fixing circular reference in calculated column
- 5 years ago
Hi Dudeman ;
When you use Live connection, you can not add columns, So maybe you could try to modify the MaxArrival2 column by the following formula:
MaxArrival2 = CALCULATE ( MAX ( 'Legs'[arrivalTime] ), FILTER ( ALL ( 'Legs' ), [BookingNumber] = EARLIER ( [BookingNumber] ) && [ArrivalDate] = EARLIER ( [ArrivalDate] ) ) )The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Dudeman ,
You could create two columns by the following formula:
MaxArrival2 = CALCULATE(MAX( 'Legs'[arrivalTime]),ALLEXCEPT ('Legs','Legs'[BookingNumber],'Legs'[ArrivalDate]))Result Destination 2 =
IF (
[arrivalTime]
= CALCULATE (
MIN ( [arrivalTime] ),
FILTER (
ALLEXCEPT ( Legs, Legs[BookingNumber] ),
[arrivalTime] = [MaxArrival2]
)
),
[arrivalAirport]
)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft thanks Yalan. That does work in the sample file and I appreciate the help so much.
However, when I try it in my actual file I'm unable to get the Calculate or AllExcept functions to work in the formula. I think it has to do with the fact I'm connected to a live PBI dataset my BI team has created (or the fact I'm on an Enterprise version of PBI maybe).
Is there a workaround for live datasets? I tried to add the column to the Master Airports table, where it does work, but when I add it to the viz it breaks and a black box pops up and disappears very quickly with some kind of SQL error. I can't screenshot it - it's too fast.
Thoughts?