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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
matus_jun
Frequent Visitor

Time sheet dont have all date

matus_jun_0-1736933251041.png
Hi im sorry for my english 
my shift_date dont have date when employee dont work and I cant count Consecutive workday 
can I fill shift_date and if that day have no data workday = 0 
please Help me how to it 
thank you alot

 

10 REPLIES 10
v-tangjie-msft
Community Support
Community Support

Hi @matus_jun ,

 

Thanks timalbers for the quick reply. I have some other thoughts to add:

(1) My test data and data model are the same as yours.

vtangjiemsft_0-1737353311988.png

vtangjiemsft_1-1737353323233.png

(2) Create a measure.

Workday = IF(MAX('Table'[shift_date]) in VALUES('CALENDAR'[Date]),1,0) 

(3) Then the result is as follows.

vtangjiemsft_2-1737353508942.png

 

Best Regards,

Neeko Tang

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

timalbers
Super User
Super User

Hi @matus_jun ,
you may want to create a date table within your model. You could do this with the following DAX code:

calendar_table = CALENDARAUTO()

 

Afterwards you just need to connect the date column of the newly created date table with your shift_date column in the model view. You can now use the new column for your visual instead of the shift_date column.

 

This will ensure that you can show every day and not just the days in your fact table.


—————————————————————————————
If my answer helped you, please consider marking it as a solution
— it helps the community and makes DAX errors feel less lonely

matus_jun_0-1736936699497.png

Thank you alot but I got date as blank when i use it with emp_id
did I do something wrong?

This happens often when there is no proper relationship between the fields. 

It's hard to tell exactly, as I don't know how your model is set up.

Could you share a screenshot of your model view?


—————————————————————————————
If my answer helped you, please consider marking it as a solution
— it helps the community and makes DAX errors feel less lonely

matus_jun_0-1736938794996.png
this is my model view

Try to set up a filter in the filter pane after selecting your visual.

Something like this: "Date" is not blank


—————————————————————————————
If my answer helped you, please consider marking it as a solution
— it helps the community and makes DAX errors feel less lonely

matus_jun_0-1736939084255.png

Im sorry but I still got blank value

 

I'm sorry to hear that, but I fear I am not able to help you without taking a deeper look inside your model. Is it possible for you to share a example pbix file? Remeber to remove all sensitive information you don't want to share.


—————————————————————————————
If my answer helped you, please consider marking it as a solution
— it helps the community and makes DAX errors feel less lonely

How can I send it to you?

 

You may upload your file to a cloud storage (like OneDrive, Dropbox, Google Drive or Wetransfer for example) and paste the link to that storage location.


—————————————————————————————
If my answer helped you, please consider marking it as a solution
— it helps the community and makes DAX errors feel less lonely

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.