Forum Discussion
Histogram custom bins
- 9 years ago
Hi, Kumar11109
There will be a menu when you click “1”, choose “New Group”, then you can see scene “6”. Let Group type be “Bin”, then choose Bin size as 2. As you can see the data in “5”, all the data group by 2 or whatever you want (>2, 2-4, 4-6 , 6-8).
Ps: 1. The axis and the value are the same column “Total Time Spent”.2. Reference: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-grouping-and-binning/
What are groups ??
Hi, Kumar11109
Don't you want to create bins? Bins is a kind of group. Such as 0-2, 2-4, 4-6... You can see the "Group Type" is "Bin". If not so, please clarify your needs. Like what the histogram is.
- Kumar111099 years agoHelper IV
I was able to create a histogram with the process that you said. But there is another problem that I am facing. There are multiple sessions. I am attaching an image of an excel. You can see below that for each session that students have seen multiple resources. And for each resource, there is time spent given in column 3. Now in the 4th column each for each session there is total time, which is the sum of time spent on each resource. Now with your method, the time spent is taking the duplicate values of each session and not removing them. Keep one thing in mind that I don't want to remove the duplicate values because I would require them for different calculations.
Thank you for your help!!! :-D
- v-jiascu-msft9 years agoMicrosoft Employee
Hi, Kumar11109
Maybe you want to display every session in the visual. We can use "Time Spent" directly and leave "Total Time spent" alone. There are no duplicate values now. The visual below is created with your new data. Maybe this could be a little help.
- Kumar111099 years agoHelper IV
If you look at the histogram, you see that time spent for session 4 and 5 is actually 23 and 15 respectively and not 6. The x-axis should be based on total time spent in a session. I can't seem to find a way to do it. Is there a code in DAX that can help me do this??