The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I have an AIRCRAFT table which contains data of when each aircraft starts and finishes operating for my company. If you notice, aircraft CCC starts operating later than AAA and BBB. This is where the challenge starts.
Table AIRCRAFT
I also have a UTILIZATION table which contains data of the flights each aircraft does each day. For simplicity, each aircraft (AAA, BBB and CCC) operates 1 FC (Flight Cycle) each day.
Table UTILIZATION
I now want to filter the UTILIZATION table dynamically to filter only the flights that my company has flown (ie: I have to discard the flights that aircraft CCC did NOT operate for my company). So in this example, I would have to discard the rows with aircraft CCC flying on dates 01/01/2019 to 04/01/2019, as I have marked in yellow on the UTILIZATION table.
How can I do this dynamically/automatically referring to the AIRCRAFT table with the START and END dates for each aircraft? I think I would have to use a VAR but can't figure out how to make it work. Any help is very much appreciated.
Thanks and regards!
Solved! Go to Solution.
Hi @Anonymous
Create relationship as below
Create calcuated columns in 'UTILIZATION' table
related_start = RELATED(AIRCRAFT[start]) related_start = RELATED(AIRCRAFT[start]) filter_column = IF([date]>=[related_start]&&[date]<=[related_end],1,0)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Create relationship as below
Create calcuated columns in 'UTILIZATION' table
related_start = RELATED(AIRCRAFT[start]) related_start = RELATED(AIRCRAFT[start]) filter_column = IF([date]>=[related_start]&&[date]<=[related_end],1,0)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-juanli-msft,
Thank you very much for your prompt reply.
It's indeed a very simple solution but I hadn't come accross the RELATED formula.
I guess this might decrease performance as I'm adding two more calculated columns, but it seems to work perfectly. I will have to implement it in the real case but I don't think there should be any other problems rising from this.
Thanks again and regards!