Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have the following data
orders sales customername hour
1:00:00 am
2:00:00 am
3:00:00 am
4:00:00 pm
6:00:00 pm
Solved! Go to Solution.
Hello @Anonymous
The problem you are running into is, by adding customer into your visual, you introduce a filter context that is causing your MAX('OrderShpments'[Order Hour]) to look at only the rows for the customer. The reason the total is correct is because, on that row, there is no customer to change your filter so the right MAX('OrderShpments'[Order Hour]) is coming through.
Try something like this.
Sales in Last Hour = VAR LastHour = CALCULATE ( MAX ( 'OpenShipments'[Order Hour] ), ALL ( 'OpenShipments' ) ) RETURN CALCULATE ( SUM ( OpenShipments[MDSE] ), 'OpenShipments'[Order Hour] = LastHour )
The ALL in CALCULATE ( MAX ( 'OpenShipments'[Order Hour] ), ALL ( 'OpenShipments' ) ) sets the LastHour VAR to be the highest hour across the whole table, regardless of customer.
I have attached my sample file for you to look at.
Hello @Anonymous
The problem you are running into is, by adding customer into your visual, you introduce a filter context that is causing your MAX('OrderShpments'[Order Hour]) to look at only the rows for the customer. The reason the total is correct is because, on that row, there is no customer to change your filter so the right MAX('OrderShpments'[Order Hour]) is coming through.
Try something like this.
Sales in Last Hour = VAR LastHour = CALCULATE ( MAX ( 'OpenShipments'[Order Hour] ), ALL ( 'OpenShipments' ) ) RETURN CALCULATE ( SUM ( OpenShipments[MDSE] ), 'OpenShipments'[Order Hour] = LastHour )
The ALL in CALCULATE ( MAX ( 'OpenShipments'[Order Hour] ), ALL ( 'OpenShipments' ) ) sets the LastHour VAR to be the highest hour across the whole table, regardless of customer.
I have attached my sample file for you to look at.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |