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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Pucca121
Helper II
Helper II

ADD Hours

hoursproblem.PNG

Hello!

 

I would like to add 3 hours on this table. I have this error message when I try to do it. Can someone explain me why and how to fix it?

 

Thank you very much

2 ACCEPTED SOLUTIONS

Power Query (M) is the language to get and transform your data into your data model.

DAX is the language to operate on data in your data model.

Both are completely different languages.

 

Basically Power Query comes first and then you can further manipulate your data with DAX.

Of course there are grey areas that can be covered by both.

Anything you do with DAX won't be available for Power Query, so that's why you don't see your table that is created with DAX (if I'm correct).

So for your Calendrier you can only proceed with DAX.

 

This works for me:

Add Hours.png

Specializing in Power Query Formula Language (M)

View solution in original post

Thank you very much 🙂 The formula works for me too. Now, I will see if it's the solution to my problem!

View solution in original post

7 REPLIES 7
MarcelBeug
Community Champion
Community Champion

You are mixing up DAX and Power Query (M).

Do you want to add 3 hours to your Date field?

Is that a date or a datetime field?

Specializing in Power Query Formula Language (M)

hoursprob1PNG.PNG

 

Yes, I think. When I go to EDIT QUERY, I don't see this table, I don't know why...

Is a major difference between DAX and Power Query (M)??

Power Query (M) is the language to get and transform your data into your data model.

DAX is the language to operate on data in your data model.

Both are completely different languages.

 

Basically Power Query comes first and then you can further manipulate your data with DAX.

Of course there are grey areas that can be covered by both.

Anything you do with DAX won't be available for Power Query, so that's why you don't see your table that is created with DAX (if I'm correct).

So for your Calendrier you can only proceed with DAX.

 

This works for me:

Add Hours.png

Specializing in Power Query Formula Language (M)

Thank you very much 🙂 The formula works for me too. Now, I will see if it's the solution to my problem!

Hello!

 

The formula works but it doesn't fix my problem, which is:

 

When a select a day, it returns me the sales informations of the day after.  So, I tried to fix this changing the calendar hour, and put it 3 hours after midnignt, but it doesn't work.

 

I have these TIME formulas:

 

Calendrier

= CALENDARAUTO()

 

Salesday

 = CALCULATE(SUM(Calendrier[Is Working Day]);DATESBETWEEN(Calendrier[Date];RELATED('Data Mailing'[Date premiere vente]); Set[datedecredit]))

 

Is Working Day

= SWITCH(WEEKDAY(Calendrier[Date]);7;0;1;0;1)

 

I also have a date in a table. In fact,  each sale has a row with a date. Is the query, it's a date but without hour.

 

Can you help me please??  🙂

 

P.

 

 

 

 

 

No. I don't think I can help you. My DAX knowledge is rather limited.

My suggestion would be to create a new topic (as this one is already marked as answered) and explain what you want to achieve.

I would focus on the phenomenon that you select a day and you get sales informations of the day after.

That is very strange so you should clarify and explain with sharing your code and some example data. In a new topic.

Specializing in Power Query Formula Language (M)

Thank you 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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