I want to join two tables `Data` and `Priority` and create a new column in the `Data` table which is Data.Reason_Final
join tables on Data. Reason = Priority.Reason and Data.Reason_Final = min(Priority.PriorityOrder) based on group by Data.ID
Could you please help me figure out how to do this in PowerBI?
Go to Solution.
Please try this calculated column
FILTER ( Data, [ID] = EARLIER ( [ID] ) ),
RELATED ( Priority[PriorityOrder] ), ASC
View solution in original post
If there's no relationship between the tables Data and Priority, you can create a new calculated column:
VAR IDReasons_ =
CALCULATETABLE ( DISTINCT ( Data[Reason] ); ALLEXCEPT ( Data; Data[ID] ) )
VAR AuxTable_ =
CALCULATETABLE ( Priority; TREATAS ( IDReasons_; Priority[Reason] ) )
DISTINCT ( Priority[Reason] );
TOPN ( 1; AuxTable_; [PriorityOrder]; ASC )
Thanks a lot!
Read the announcement for more information!
We're rolling out new Kudos Given badges. Find out how many Kudos you've given.
Get an overview of the events and great community content from November.
Find out where you can attend!