Forum Discussion
Anonymous
3 years agoNot applicable
Create pie chart with categories using a measure
Hi, I have data with customer ids where each row represents transaction info. I am supposed to find average transaction per day for each customer. There is a slicer for date where I can choose last ...
ValtteriN
Community Champion
3 years agoHi,
One way to go about this is to create a SWITCH measure for categorizing. Then you can use this measure as a slicer or create a table containing the categories (if you want them to your pie chart legend).
Here I created a measure for classifying my data. E.g. I want to know more than 300, less than 99 and less than 299.
Data:
Dax:
Category_ =
var _sum = SUM(Cakes[Sums])
Var _test =
SWITCH(TRUE(),
_sum>299,"Category 1",
_sum<99,"Category 2",
_sum<299,"Category 3")
return
_test
End result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
End result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/