Prefer Order Time (Hour of the day)

@MAAbdullah47

If I understand it correctly, you need the Highest # of orders that can be filtered by (per day - week - month - year). I have a solution based on the assumption I mentioned.

I added a continuous date table in the model that is prepared by @Melissa

Then in the data you provided, separated the Hour from Order Time in Power Query.

You have duplicate Order Numbers but they are generated on a different time frame and different Products are ordered on the same order number that’s why didn’t count duplicate order numbers as ONE instead treated every Order as Unique. Moreover, in the dataset provided, many Order Dates are missing that’s why the slicers are showing Blanks also.

The measure to calculate the Highest # of orders by Hour is

Max Orders by Hour =
VAR vTable =
    CALCULATETABLE (
        ADDCOLUMNS ( SUMMARIZE ( 'Table', 'Table'[Hour] ), "@Orders", [# Of Orders] ),
        ALLSELECTED ()
    )
VAR MaxOrders =
    MAXX ( vTable, [@Orders] )
VAR Result =
    IF ( [# Of Orders] = MaxOrders, MaxOrders, BLANK () )
RETURN
    Result

The final result is as follows:

Attaching the PBIX file and source file.

Let us know if this is what you are looking for.

Thanks.

Prefer Order Time Solution.pbix (1.9 MB)

1 Like