Forum Discussion

ValentinBIA's avatar
ValentinBIA
Resolver I
8 years ago
Solved

Date / Lookup Tables

Morning dear Power BI users!   I am working on the data for car rentals. The cars leave from a station and parks in a station. In my main query, I have the StationFrom column, the StationTo, and t...
  • JoHo_BI's avatar
    8 years ago

    Hi Valentin,

     

    Always happy to help a Skyrim fan!

     

    You can create a relationship to both, but only one will be active. But then in your calculations you can use the USERELATIONSHIP function to reference the inactive relationship instead. For example:

     

    No. Rentals = CALCULATE(SUM(Table[Rentals]), USERELATIONSHIP(LookupTable[Station], Table[StationFrom]))

     

    Otherwise, there is a LOOKUPVALUE function that may be of use.

     

    Hope that helps!