Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Expert,
I want to take average for the month ffor the attached data sets.
I need to consider only Sickess from the Main Category column.
I have one Fact table as per below and one DIM table which contain date.
Apprecaite your assistance.
Expected Result - Average Sickness for Feb-23 = 2.5
Date | Employee No. | Code | Main Category |
01-02-23 | 123456 | SICK | Sickness |
01-02-23 | 123457 | SICK | Sickness |
01-02-23 | 123458 | SICK | Sickness |
01-02-23 | 123459 | LVE | Others |
01-02-23 | 123460 | LVE | Others |
01-02-23 | 123461 | LVE | Others |
02-02-23 | 123462 | LVE | Others |
02-02-23 | 123463 | LVE | Others |
02-02-23 | 123464 | COVD | COVD |
02-02-23 | 123465 | COVD | COVD |
02-02-23 | 123466 | COVD | COVD |
02-02-23 | 123467 | COVD | COVD |
02-02-23 | 123468 | COVD | COVD |
02-02-23 | 123469 | NOAV | Others |
02-02-23 | 123470 | NOAV | Others |
02-02-23 | 123471 | NOAV | Others |
02-02-23 | 123472 | NOAV | Others |
02-02-23 | 123473 | NOAV | Others |
02-02-23 | 123474 | NOAV | Others |
03-02-23 | 123456 | SICK | Sickness |
03-02-23 | 123457 | SICK | Sickness |
03-02-23 | 123458 | SICK | Sickness |
03-02-23 | 123459 | LVE | Others |
03-02-23 | 123460 | LVE | Others |
03-02-23 | 123461 | LVE | Others |
03-02-23 | 123462 | LVE | Others |
03-02-23 | 123463 | LVE | Others |
03-02-23 | 123464 | COVD | COVD |
03-02-23 | 123465 | COVD | COVD |
03-02-23 | 123466 | COVD | COVD |
04-02-23 | 123467 | COVD | COVD |
04-02-23 | 123468 | COVD | COVD |
04-02-23 | 123469 | NOAV | Others |
04-02-23 | 123470 | NOAV | Others |
04-02-23 | 123471 | NOAV | Others |
04-02-23 | 123472 | NOAV | Others |
04-02-23 | 123473 | NOAV | Others |
04-02-23 | 123474 | NOAV | Others |
04-02-23 | 123456 | SICK | Sickness |
04-02-23 | 123457 | SICK | Sickness |
04-02-23 | 123458 | SICK | Sickness |
04-02-23 | 123459 | LVE | Others |
05-02-23 | 123460 | LVE | Others |
06-02-23 | 123461 | LVE | Others |
06-02-23 | 123462 | LVE | Others |
06-02-23 | 123463 | LVE | Others |
06-02-23 | 123464 | COVD | COVD |
06-02-23 | 123465 | COVD | COVD |
07-02-23 | 123466 | COVD | COVD |
07-02-23 | 123467 | COVD | COVD |
07-02-23 | 123468 | COVD | COVD |
07-02-23 | 123469 | NOAV | Others |
07-02-23 | 123470 | NOAV | Others |
08-02-23 | 123471 | NOAV | Others |
08-02-23 | 123472 | NOAV | Others |
08-02-23 | 123473 | NOAV | Others |
08-02-23 | 123474 | NOAV | Others |
08-02-23 | 123456 | SICK | Sickness |
08-02-23 | 123457 | SICK | Sickness |
09-02-23 | 123458 | SICK | Sickness |
09-02-23 | 123459 | LVE | Others |
09-02-23 | 123460 | LVE | Others |
09-02-23 | 123461 | LVE | Others |
09-02-23 | 123462 | LVE | Others |
09-02-23 | 123463 | LVE | Others |
10-02-23 | 123464 | COVD | COVD |
10-02-23 | 123465 | COVD | COVD |
10-02-23 | 123466 | COVD | COVD |
10-02-23 | 123467 | COVD | COVD |
11-02-23 | 123468 | COVD | COVD |
11-02-23 | 123469 | NOAV | Others |
11-02-23 | 123470 | NOAV | Others |
11-02-23 | 123471 | NOAV | Others |
12-02-23 | 123472 | NOAV | Others |
12-02-23 | 123473 | NOAV | Others |
12-02-23 | 123474 | NOAV | Others |
12-02-23 | 123456 | SICK | Sickness |
12-02-23 | 123457 | SICK | Sickness |
12-02-23 | 123458 | SICK | Sickness |
12-02-23 | 123459 | LVE | Others |
12-02-23 | 123460 | LVE | Others |
13-02-23 | 123461 | LVE | Others |
13-02-23 | 123462 | LVE | Others |
13-02-23 | 123463 | LVE | Others |
13-02-23 | 123464 | COVD | COVD |
13-02-23 | 123465 | COVD | COVD |
13-02-23 | 123466 | COVD | COVD |
14-02-23 | 123467 | COVD | COVD |
14-02-23 | 123468 | COVD | COVD |
14-02-23 | 123469 | NOAV | Others |
14-02-23 | 123470 | NOAV | Others |
14-02-23 | 123471 | NOAV | Others |
14-02-23 | 123472 | NOAV | Others |
14-02-23 | 123473 | NOAV | Others |
@Enan - Did this work? Please could you mark it as the solution if yes, this helps other users find it.
@Enan - Try this in a measure:
VAR sick = CALCULATE( COUNT( Table[Employee No]), KEEPFILTERS( Table[Main Category] = "Sickness"))
VAR _total = CALCULATE( COUNT( Table[Employee No]), REMOVEFILTERS( Table[Main Category] ))
RETURN
DIVIDE( sick, _total, 0 )
Screenshot below shows its working with the data available:
If this works, please mark it as the solution.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |