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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Diportee97
Helper I
Helper I

Date Function Problem

IMG_0676.jpeg

Hello everyone, I'm facing a major issue with the Date function in Power BI. The function correctly matches the original data's date, and both are properly linked. However, the problem occurs on my dashboard—whenever I select a year in the slicer, my card visuals return empty values. I’d really appreciate any help or possible solutions. Thanks in advance!

2 ACCEPTED SOLUTIONS

Hi @Diportee97 

 

The main issue is calendar table, date column(Date/time data type) having same time for all dates(shows 12:00 AM for all dates). It means whenever you filter the data it will look for same date and time. That's why you can't see the data.

Hence, I changed date column as 'Date' data type only ratherthan Date/time data type in the calendar table and created a new date column with 'Date' data type only in Hosptial_ER table.

Now you can able to see the data. Here I am attching a smaple .pbix file url
https://drive.google.com/file/d/1lTR79-mNM_p46hzSqp5kptNrFA2IrvoI/view?usp=sharing
  

ajaybabuinturi_0-1740028985058.png

 

ajaybabuinturi_1-1740029020075.png

PBI Commu Signature.png

View solution in original post

Anonymous
Not applicable

Hi @Diportee97 

 

Thanks for the reply from Murtaza_Ghafoor and ajaybabuinturi .

 

My suggestion is to create a date column in both the Calendar and Hospital ER tables, and then create a relationship between the two tables based on this column.

 

Date without time = FORMAT('Hospital ER'[Date], "yyyy-mm-dd")

 

Date without time = FORMAT('Calendar'[Date], "yyyy-mm-dd")

 

vxuxinyimsft_0-1740045893276.png

 

Output:

vxuxinyimsft_1-1740045968273.png

 

This is done because the time in the calendar table is 12:00am, through my test, if the column with time is used as a slicer, only the data at 12:00am in the Hospital ER table can be filtered.

vxuxinyimsft_2-1740046302137.png

 

Best Regards,
Yulia Xu

 

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

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @Diportee97 

 

Thanks for the reply from Murtaza_Ghafoor and ajaybabuinturi .

 

My suggestion is to create a date column in both the Calendar and Hospital ER tables, and then create a relationship between the two tables based on this column.

 

Date without time = FORMAT('Hospital ER'[Date], "yyyy-mm-dd")

 

Date without time = FORMAT('Calendar'[Date], "yyyy-mm-dd")

 

vxuxinyimsft_0-1740045893276.png

 

Output:

vxuxinyimsft_1-1740045968273.png

 

This is done because the time in the calendar table is 12:00am, through my test, if the column with time is used as a slicer, only the data at 12:00am in the Hospital ER table can be filtered.

vxuxinyimsft_2-1740046302137.png

 

Best Regards,
Yulia Xu

 

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

Hi @Diportee97 

 

The main issue is calendar table, date column(Date/time data type) having same time for all dates(shows 12:00 AM for all dates). It means whenever you filter the data it will look for same date and time. That's why you can't see the data.

Hence, I changed date column as 'Date' data type only ratherthan Date/time data type in the calendar table and created a new date column with 'Date' data type only in Hosptial_ER table.

Now you can able to see the data. Here I am attching a smaple .pbix file url
https://drive.google.com/file/d/1lTR79-mNM_p46hzSqp5kptNrFA2IrvoI/view?usp=sharing
  

ajaybabuinturi_0-1740028985058.png

 

ajaybabuinturi_1-1740029020075.png

PBI Commu Signature.png

ajaybabuinturi
Solution Sage
Solution Sage

Hi @Diportee97 ,

I belive the relationship between date table and data table(fact) is not properly set-up or fact table data may be in other data type.

I would recommend check the date column datatypes and it should be in 'Date' datatype.

  • IMG_0685.jpeg

IMG_0683.jpeg

IMG_0684.jpeg

 These are my calendar table and fact table and all data types are in date type,plus the table were all connected appropriately 

Could you please share the sample bi report. if possible.

Murtaza_Ghafoor
Helper II
Helper II

Please  check  the relationship between  dates.

IMG_0683.jpeg

IMG_0684.jpeg

IMG_0685.jpeg

    These are my calendar table and fact table and all data types are in date type,plus the table were all connected appropriately 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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