Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Measure Values as Graph Category (Pie Graph Detail) Workaround?

Hello,

 

I am working through creating a power bi report which looks at badge data. The report shows daily aggregations, percentiles, and other info and responds to a number of filters (buildings, dates and/or day of week, groupings such as department, etc.). The dataset has raw badge data which may have more than one badge per day per badge number (see below for small/vague sample)

 
ACCESS_BADGE_NUMBERBUILDING_NAMEBADGE_SCAN_DATE
1Office X02/19/2020
1Office Y02/20/2020
1Office X02/21/2020
1Office X02/21/2020
1Office Y02/21/2020
1Office X02/24/2020
 
 

One graph I am trying to add in looks at badges per week. Essentially, I want to distribute at a weekly level per badge - how many days of the week did someone badge in?

 

I created an unique ID that looks at year + week + badge number and was able to create a measure of DISTINCTCOUNT(Date) to get what I wanted when paired with the unique ID in a table vizualization. My issue however, is that when I change the viz to a donut graph, I want to break out the categories by the days per week values (and count the number of unique IDs with the corresponding days per week).

 

My understanding is that you cannot put measures as the legend/detail of a donut graph, so i tried to create a calculated column to count days per week. I got this to work, but my issue with this is the column will not react to date or day of week slicers (my understanding is this is expected with calculated columns due to how its loaded in with the data). See below for details :

 

 

Is there a workaround for this? The below is essentially the goal : the graph showing the count of unique IDs with the categories being the number of days per week as well with the ability for the count of days per week to react on filters (ex. If only monday & tuesday were selected for the day of week, I would expect the number of days per week to be, at most, 2)

2 REPLIES 2
speedramps
Super User
Super User

Hi Danny

 

How much Power BI do you know?

 

Had you considered using M queries to convert your single file into a star schema. For example:-

 

  • DimDates:-
    • Date
    • Day of Week
    • Week number

  • DimDoors:-
    • Door ID
    • Building name
    • Department name
    • City
    • Country

 

  • DimBadges:-
    • Badge ID
    • Staff Name

 

  • FactScans:-
    • Badge ID
    • Door ID
    • Type (scan in or scan out)
    • Date
    • Time

 

Then creating DAX measures and graphs to gain insights.

For example how many staff needed access to the Rome factory building in January 2020.

Or which teams needed weekend to HR departments in Italy, France or Spain in 1999.

Or staff who have accessed departments this month that they have never access before.

Or staff who have not accessed a door for more than 6 months. Should their access be revoked?

 

Incidentally, it is best practice not to use pie and donut charts for data that has more that 2 or 3 categories, unless you must.  It is best to use bar graphs when comparing volumes by categories and using line graphs when tracking trends by time.    

 

v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Could you please share some sample data and clarify more details about your requirement and expected result?

 

Regards,

Jimmy Tao

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.