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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Associate a value to a specific date

Hi everyone,

 

Please I need your help,

TIME.PNG

TIME2.PNG

I'm calculating the time past by day, on this example the FRE_NextTime finished on the next day, then i calculate MINUIT that mean from FRE_Time to midnight, 115.47 minuts for February 8, and did the same for the next day of February 9, MATIN is the rest from FRE_NextTime back to midnight, the MATIN, 363.73 min belongs to the next day February 9.

 

I need to associate the value of MATIN to the right date, in this case FRE_NextTime - Copier.

I tried this:

 

TIME = IF(TBL_RESULTS[FRE_Time - LIAISON]<>TBL_RESULTS[FRE_NextTime - Copier];CALCULATE(SUM(TBL_RESULTS[MATIN]);NEXTDAY(TBL_RESULTS[FRE_Time - LIAISON])).

 

Thanks a lot,

7 REPLIES 7
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a sample to test:

20.PNG

Then try these two columns:

MINUIT = DATEDIFF('Table'[FRE_Time],'Table'[FRE_Time-LIAISON]+TIME(0,0,0)+1,SECOND)/60
MATIN = DATEDIFF('Table'[FRE_NextTime-Copier]+'Table'[FRE_NextTime],'Table'[FRE_NextTime-Copier]+TIME(0,0,0)+1,SECOND)/60

The result shows:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

But i still need to associate for example, the MATIN's value (1076,28) to the right date (February 9) when i filter by date.

 

 

the problem here, is when I select a date ( February 😎 i have to see all the MINUIT's value and for  ( February 9) all the MATIN's value because of is after the midnight and it belong to the next day of 8.

cc.PNGcc1.PNG

Thanks,

 

Hi,

 

I am still confused about your requirement.

Could you please explain more about your requirement and expected result for me to help you further.

Thanks!

Expect your reply!

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

ab.PNG

Here is the real data,

My expected result appears on TIME column with those conditions:

if FRE_NextTime - Copier <> FRE_Time - LIAISON then :

 

MINUIT: 

IF(TBL_RESULTS[FRE_Time - LIAISON]<>TBL_RESULTS[FRE_NextTime - Copier];HOUR(24)-TBL_RESULTS[FRE_Time - Copier]

MATIN:

IF(TBL_RESULTS[FRE_Time - LIAISON]<>TBL_RESULTS[FRE_NextTime - Copier];(TBL_RESULTS[FRE_NextTime]-HOUR(24)
 
So:
I want to: TIME = if FRE_NextTime - Copier <> FRE_Time - LIAISON ; associate every MINUIT's value to FRE_TIME - LIAISON OR/AND associate every MATIN's value to FRE_NextTime - Copier
 
Thanks a lot,

Hi,

 

According to your posted screenshot, please try this column:

Time =
IF (
    'TBL_RESULTS'[MINUIT] <> BLANK (),
    'TBL_RESULTS'[MINUIT],
    'TBL_RESULTS'[CYCLE]
)

 

Best Regards,

Giotto

Anonymous
Not applicable

Hi,

 

What about MATIN status?

 

Tks,

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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