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

Count blanks in a column where dates are missing using measure

Ali007_0-1656261575337.png

We have table1 in which we are showing  "Mahar Ali" attendance.
We have to count that days in which "Mahar" is absent (as shown in table 2) but we have to create a measure or custom column.
In screenshot i am using (show item with no data) but this has to be done without using of (show item with no data).

PunchInDate,Employee columns are from FACT_TABLE
Date,Days columns are from Dim_Date


Please Help!!!



1 ACCEPTED SOLUTION

Hi,

In the DimDate table, write this calculated column formula

Weekday = weekday(Calendar[Date],2)

Revised the second measure to:

Absent = countrows(filter(values('DimDate'[Date]),[Emp count]=0&&'DimDate'[Weekday]<=5))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Write this measure and drag it to a card visual

Emp count = counta(fact_table[EmpID])

Absent = countrows(filter(values('DimDate'[Date]),[Emp count]=0))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

thanks for the help ashish , it is working but i want to exclude weekends also.

Hi,

In the DimDate table, write this calculated column formula

Weekday = weekday(Calendar[Date],2)

Revised the second measure to:

Absent = countrows(filter(values('DimDate'[Date]),[Emp count]=0&&'DimDate'[Weekday]<=5))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks for the reply, i have tried this before but it is not working .
Because after && it will accept measure not calculated column.

Ali007_2-1656406568737.png

 

Hi,

Does this measure work?

Absent = countrows(filter(values('DimDate'[Date]),[Emp count]=0&&weekday(Calendar[Date],2)<=5))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

it is working now thank you !!!!!!!!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.