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 a field DateTime, Sales and Customer. Here I want to show time range like 12AM-6AM, 6AM-12PM, 12PM-6PM,6PM-12AM in axis along with date means I have to see at which time range sales are happening for all the dates. Can anyone help me on it.
TIA.
Regards,
Srivalli
Solved! Go to Solution.
Hi Srivally,
You could achieve this by either making a calculated column. Below you'll find an example. If you want to customize the labels such as in the calculated column example, keep in mind that you will also need to add a second calculated column in order to rank the categories correctly (since the custom labels will be text and therefore ordered alphabetically). Below you'll also find an example of how you can make a sorting column.
TimeBucket =
SWITCH (
TRUE (),
HOUR ( 'public click'[utcTimeStamp] ) IN { 0, 1, 2, 3, 4, 5 }, "12AM - 6AM",
HOUR ( 'public click'[utcTimeStamp] ) IN { 6, 7, 8, 9, 10, 11 }, "6AM - 12PM",
"ETC."
)
TimeBucketRank =
SWITCH (
TRUE (),
HOUR ( 'public click'[utcTimeStamp] ) IN { 0, 1, 2, 3, 4, 5 }, 1,
HOUR ( 'public click'[utcTimeStamp] ) IN { 6, 7, 8, 9, 10, 11 }, 2,
3
)
An alternative would be to create a group with a 6 hour interval size. However, this method does give you fixed labels so you would be required to change these afterwards if you want custom labels
Best regards,
Tim
Proud to be a Super User!
Hi Srivally,
You could achieve this by either making a calculated column. Below you'll find an example. If you want to customize the labels such as in the calculated column example, keep in mind that you will also need to add a second calculated column in order to rank the categories correctly (since the custom labels will be text and therefore ordered alphabetically). Below you'll also find an example of how you can make a sorting column.
TimeBucket =
SWITCH (
TRUE (),
HOUR ( 'public click'[utcTimeStamp] ) IN { 0, 1, 2, 3, 4, 5 }, "12AM - 6AM",
HOUR ( 'public click'[utcTimeStamp] ) IN { 6, 7, 8, 9, 10, 11 }, "6AM - 12PM",
"ETC."
)
TimeBucketRank =
SWITCH (
TRUE (),
HOUR ( 'public click'[utcTimeStamp] ) IN { 0, 1, 2, 3, 4, 5 }, 1,
HOUR ( 'public click'[utcTimeStamp] ) IN { 6, 7, 8, 9, 10, 11 }, 2,
3
)
An alternative would be to create a group with a 6 hour interval size. However, this method does give you fixed labels so you would be required to change these afterwards if you want custom labels
Best regards,
Tim
Proud to be a Super User!
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |