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.
Hello,
I need a little help trying to create a few attendance tracking visuals and ran into a challenge.
I have following fields: Person, CalendarDate, AbsReason, TotalAbs, Shift, Location, etc.
I'm trying to show:
My challenge is with number 1 that I'm trying to build using a TreeMap.
Attendance is typcially recorded twice - morning and afternoon and is typically recorded as 0.5 each time.
A mock of my data would be like:
Person Date TotalAbs
1 Oct 5, 2020 0.5
1 Oct 6, 2020 1.0
1 Oct 7, 2020 1.0
1 Oct 8, 2020 0.5
2 Oct 5, 2020 0.5
2 Oct 6, 2020 0.5
2 Oct 7, 2020 0.5
2 Oct 8, 2020 0.5
5 Oct 5, 2020 1.0
5 Oct 6, 2020 1.0
5 Oct 7, 2020 1.0
5 Oct 8, 2020 1.0
5 Oct 9, 2020 1.0
5 Oct 12, 2020 1.0
5 Oct 13, 2020 1.0
5 Oct 14, 2020 1.0
5 Oct 15, 2020 1.0
5 Oct 16, 2020 1.0
5 Oct 19, 2020 1.0
5 Oct 20, 2020 1.0
5 Oct 21, 2020 1.0
5 Oct 22, 2020 1.0
5 Oct 23, 2020 1.0
9 Oct 5, 2020 0.5
9 Oct 6, 2020 1.0
9 Oct 7, 2020 1.0
9 Oct 8, 2020 1.0
9 Oct 9, 2020 1.0
9 Oct 12, 2020 0.5
9 Oct 13, 2020 1.0
9 Oct 14, 2020 1.0
9 Oct 14, 2020 0.5
9 Oct 15, 2020 0.5
9 Oct 16, 2020 0.5
If I add the 'Shift' field to the table, I then have
Person Date TotalAbs Shift
1 Oct 5, 2020 0.5 am
1 Oct 6, 2020 0.5 am
1 Oct 6, 2020 0.5 pm
1 Oct 7, 2020 0.5 am
1 Oct 7, 2020 0.5 pm
1 Oct 8, 2020 0.5 am
1 Oct 8, 2020 0.5 am
etc etc etc
My first challenge pertains to a TreeMap, which I've used successfully a number of times.
I can drag the TotalAbs to the Group, but it only shows those that have 0, 0.5 or 1. When I use TotalAbs in the 'group' field, there is no option of 'summing, counting, etc ' the TotalAbs. I created an measure that counted the TotalAbs but could not drag this measure into the Group Field of the TreeMap.
Thoughts?
My Map shows everyone with 0.5 or 1 absence in two large groups, whereas, I am looking to cluster people into groups of 1,2,3,4,5,6,7, etc.
I will work on how to reduce this specific totals e.g., 5,10,15 once I can figure out what I'm doing incorrectly.
FYI: here was one of a few Meaures that I experimented with.
Solved! Go to Solution.
Hello @SO ,
You cannot use TotalABS has a group field in the tree map because the values have 1 and 0.5.
You must create a new table with the groupings you need in my case I created the following table:
Category table = GENERATESERIES(0,5 ; 100 ; 0,5)
This will generate a table with all values between 0.5 and 100 with the value 0.5 in the range:
TotalCount =
VAR temp_table =
SUMMARIZE (
ALLSELECTED ( 'Table'[Person] );
'Table'[Person];
"@Totalabsvalue"; SUM ( 'Table'[TotalAbs] )
)
RETURN
COUNTROWS (
FILTER (
temp_table;
[@Totalabsvalue] = SELECTEDVALUE ( 'Category table'[Value] )
)
)
In the example that you place I added another user with similar data has user 9 result is down and in attach PBIX file.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHello @SO ,
You cannot use TotalABS has a group field in the tree map because the values have 1 and 0.5.
You must create a new table with the groupings you need in my case I created the following table:
Category table = GENERATESERIES(0,5 ; 100 ; 0,5)
This will generate a table with all values between 0.5 and 100 with the value 0.5 in the range:
TotalCount =
VAR temp_table =
SUMMARIZE (
ALLSELECTED ( 'Table'[Person] );
'Table'[Person];
"@Totalabsvalue"; SUM ( 'Table'[TotalAbs] )
)
RETURN
COUNTROWS (
FILTER (
temp_table;
[@Totalabsvalue] = SELECTEDVALUE ( 'Category table'[Value] )
)
)
In the example that you place I added another user with similar data has user 9 result is down and in attach PBIX file.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |