Hi all,
I have a huge amount of sales data (ticket ID, date, item name, quantity, turnover). This data is on item level with a unique ticket ID. So each ticket ID can have multiple items.
Now, I would like to make a histogram with different customized bin sizes based on the total ticket value.
For example: how many tickets are there with a total ticket value of 0-50€, 50-100€, 100-300€, 300-900€, and so on.
I'm a quite lost in solving this with Dax so any help to get me in the right direction would be great!
Thanks in advance!
Solved! Go to Solution.
Try this calculated column. You can add additional groupings to the SWITCH function.
Group =
VAR vTicketID = SalesTest[Ticket ID]
VAR vTicketRows =
FILTER ( SalesTest, SalesTest[Ticket ID] = vTicketID )
VAR vTotalQuantity =
SUMX ( vTicketRows, SalesTest[Quantity] )
VAR vResult =
SWITCH (
TRUE (),
vTotalQuantity > 0
&& vTotalQuantity <= 50, "0-50",
vTotalQuantity > 50
&& vTotalQuantity <= 100, "50-100"
)
RETURN
vResult
Hi,
Share some data to work with. Should the total ticket value be determined by adding up the figures in the turnover column?
Hi Ashish,
Thanks for the reply.
Unfortunately I cannot share any of the data.
The idea is indeed to see the total of the ticket value (sum of the different item on the ticket) in different bins.
Enjoy your day,
Ivan
Hi,
See if my solution at this link helps - http://www.ashishmathur.com/segment-customers-into-dynamic-buckets/
Hi @Ivan_C ,
Is your issue solved now?
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi Kelly,
I still need to check the suggestions posted here. As soon as I've been able to I'll let you know.
Thanks,
Ivan
Try this calculated column. You can add additional groupings to the SWITCH function.
Group =
VAR vTicketID = SalesTest[Ticket ID]
VAR vTicketRows =
FILTER ( SalesTest, SalesTest[Ticket ID] = vTicketID )
VAR vTotalQuantity =
SUMX ( vTicketRows, SalesTest[Quantity] )
VAR vResult =
SWITCH (
TRUE (),
vTotalQuantity > 0
&& vTotalQuantity <= 50, "0-50",
vTotalQuantity > 50
&& vTotalQuantity <= 100, "50-100"
)
RETURN
vResult
Hi,
Thanks for the quick response.
I will try out your solution as soon as possible.
Much appreciated!
Ivan
Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
464 | |
183 | |
118 | |
61 | |
52 |
User | Count |
---|---|
444 | |
167 | |
129 | |
76 | |
73 |