Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Drill through with internal SELECTEDVALUE

Hi,   I have a question in regards to drill through between two pages, each with a different dataset.   For context, I have two dataset: Billing and Booking. Given the complexity of the data, I d...
  • johnt75's avatar
    johnt75
    3 years ago

    I would recommend that you identify which dates you want to report on, e.g. order date and delivery date, and then decide how those dates are determined. You mention that items can be added to orders on different days, so is the order date the date that the first item was ordered? If items can be delivered at different times, is the delivery date the first or last date on which items were delivered?

    Once you have decided the above, you need to make sure that there is a column in your fact table for each date, and that each order has the same value for those columns. As an example you could create a column like

    Order date for reporting =
    CALCULATE (
        MIN ( 'Bookings'[Order date] ),
        ALLEXCEPT ( 'Bookings', 'Bookings'[Order ID] )
    )
    

    You would then create relationships from the date table to these new columns. Only 1 relationship can be active at once, so you would need to decide whether the primary relationship was based on order date or delivery date.

    It would probably be a good idea to create a calculation group with 2 calculation items, 1 based on the primary relationship, which would simply call SELECTEDMEASURE(), and the other based on the inactive relationship, e.g.

    CALCULATE( SELECTEDMEASURE(), USERELATIONSHIP( 'Date'[Date], 'Bookings'[Delivery date for reporting]) )

    You could then use this to switch visuals between reporting by delivery or order date.