cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Divya904 Member
Member

Remove timestamp from date

Hi Experts,

I have created a date calendar using DAX as below:

 

Date =
GENERATE (
CALENDARAUTO(),
VAR currentDay = [Date]
VAR day = DAY( currentDay )
VAR month = MONTH ( currentDay )
VAR year = YEAR ( currentDay )
RETURN ROW (
"day", day,
"month", month,
"year", year )
)

 

 I have set the the date field format as dd/mm/yyyy and data type as text and created a slicer using this. 

When publishing to web service, the slicer come up with date and time.

date01.PNG

 

Please let me know how can i remove the timestamp in the slicer.

Thanks.

 

 

 

 

 

6 REPLIES 6
Phil_Seamark Super Contributor
Super Contributor

Re: Remove timestamp from date

HI @Divya904

 

Maybe something like//

 

Date =
GENERATE (
CALENDARAUTO(),
VAR currentDay = [Date]
VAR dayShort = FORMAT(currentDay,"dd/MM/yyyy")
VAR day = DAY( currentDay )
VAR month = MONTH ( currentDay )
VAR year = YEAR ( currentDay )
RETURN ROW (
"day", day,
"short day" , dayShort,
"month", month,
"year", year )
)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Divya904 Member
Member

Re: Remove timestamp from date

Hi Phil,

 

Thanks for your reply.

Tried the same DAX calculation that you have provided. But still getting the time stamp in the slicer. 

Here is the screenshot from Desktop.

 

Date02.PNG

 

 

Thanks and Regrads,

Divya

Phil_Seamark Super Contributor
Super Contributor

Re: Remove timestamp from date

Hi @Divya904

 

It seems odd.  I tried to replicate it here and it works ok for me up in the web service.

 

I've attached a simple example PBIX file that I used.  Can you upload that and see if it does the same thing?

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Divya904 Member
Member

Re: Remove timestamp from date

Hi Phil,

Thanks for your prompt and sharing the .pbix file.

In your Date slicer, there is time as well. Please let me know how can we remove this time, so that we have just dates in the dropdown.

Thanks

 

Regards,

Divya

 

 

 

Phil_Seamark Super Contributor
Super Contributor

Re: Remove timestamp from date

I'm not sure sorry.  It's interesting that it works fine for me.  It suggests a setting in your Power BI Tenant such as region, or locale


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Divya904 Member
Member

Re: Remove timestamp from date

I know, date formats works differenctly in different machines. This is because of Power BI desktop regional settings and Browers settings for Power BI web service

I have set,

Power BI desktop , regional settings to English Australia

Web service setting is default Browser setting, which is English UK

System language and Locale setting is English Australia

 

Thanks.

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 228 members 2,572 guests
Please welcome our newest community members: