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
RitaMunha
Helper I
Helper I

Trying to build a doughnut chart based on a slicer

Hi everyone,

 

I´m new at Power BI and I`m facing some problems. 

I want to build a doughnut chart based on a slicer date. I don´t know if it`s possible

 

Table 1

Employee NameDateTime IntervalSign-INPoints

Name 1

16/03/2020WH08:00 - 09:005
Name 216/03/2020WH08:00 - 09:005
Name 316/03/2020WH09:00 - 10:004
Name 116/03/2020NWH19:00 - 20:001
Name 216/03/2020NWH20:00 - 21:001
Name 316/03/2020NWH21:00 - 22:001
Name 117/03/2020WH08:00 - 09:005
Name 217/03/2020WH09:00 - 10:004
Name 317/03/2020WH07:00 - 08:003
Name 117/03/2020NWH19:00 - 20:001
Name 217/03/2020NWH20:00 - 21:001
Name 317/03/2020NWH21:00 - 22:001

 

Table 2 (dummy values)

Employee NameData AData BData CLevel
Name 1ADGAAA
Name 2BEHBBB
Name 3CFICCC

 

Date

DateIsWorkDay
16/03/20201
17/03/20201

 

Table 1 & Date have relation based on date

Table 1 & Table 2 have relation based on Employee Name

 

Calculated Column
IsWorkDay
Points - simple metric based on the Sign-In intreval hour, that returns points for each interval

 

3 Measures
Measure 1
Nº of reported days - returns number of days between first date and last date in the slicer

 

Measure 2
Average PointsFC per user = calculate(sum(Table1[Points for Commitment]);ALLSELECTED(Table1[Date]))/(MeasuresTable[Nº of reported days])
I know the problem is in the measure "nº of reported days" because i have done a test, replacing the measure with a number and the result is fine. The problem is that i would like to recalculate the average based on the days selected in the slicer

 

Measure 3:
Level Average - if function that returns a text based on the average PointsFC per user

 

Calculated Column
Level = [Level Average]
I`m only doing this because the chart doesn`t let me insert a measure

I have insert an auxiliar table in the dashboard to compare Level and Level Average. Level Average works fine with the slicer (date) but Level (the calculated column) doesn`t. I can only reach to a formula that gives me the total average based on all days in table 1

 

What do i need? I need to contruct a doughnut graphic
Number of employees by level

 

Is this possible or should i quite this view?

Thanks in advance
(hope it`s clear enough)

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi  @RitaMunha 

you should know that:

1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

If you still have the problem, please share your sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.