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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
82186
Frequent Visitor

Subtract one time from another

The database has a counter for recording the time of signals (Date of recording) There is a machine and this machine sends a signal from the beginning of the cut (LD_11_Cnt_Saw1_Cut Start) and its completion (LD11_Cnt_Saw2_CutDone).

1.PNG

How can I make a request on DAX in which the final time will subtract the initial time and show the time of the cut itself?

2.PNG

14 REPLIES 14
lbendlin
Super User
Super User

Subtract the two values and then use FORMAT to display the duration in a meaningful way.

I understand that they need to be subtracted, but I don't understand how to do it. Can you send me a sample code?

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Is this information enough?

(Date of recording) - Date of recording
(Unit number) - unique number
(The name) - Signal name

There are two signals:
(LD_11_Cnt_Saw2_Cut Start) - start cutting
(LD11_Cnt_Saw2_Cut Done) - completion of the cut

You need to subtract (LD11_Cnt_Saw2_Cut Done) from (LD_11_Cnt_Saw2_Cut Start)

Thank you very much in advance!

Your sample data is inconsistent.  Please validate and correct.

 

lbendlin_0-1719836978241.png

 

Hello In the screenshot, you have displayed the table absolutely correctly. I have the same one. It is necessary to subtract the beginning of the cut (LD_11_Cnt_Saw2_Cut Start) from the end of the cut (ld11_cnt_saw2_cut) and thereby get the time for which the saw made the cut.

 

2.PNG

 

If necessary, I can send the file itself. But it will have the same thing as in the screenshot

The ID column in your sample was out of sequence.  Should it be ignored and the sorting be done based on timestamp instead?

I don't understand how Unit number correlate with "The name"  items.

 

lbendlin_0-1719966672963.png

Note that your datetime slicers will not work as long as they come from the same table.

 

What can you do then?

Use disconnected tables for your slicers.

Can you please send an example?

example of what?

 

Duplicate your table, or create separate tables for the time ranges. 

 

What is your business users' expectation?  Have they expressed how they would like to pick the date ranges?  Are they concerned about the amount of screen space taken up by your slicers?

IDDate of recordingUnit numberThe name 
128.06.2024 12.52.2313LD11_Cnt_Saw2_CutDone 
228.06.2024 13.11.0113LD11_Cnt_Saw2_CutDone 
328.06.2024 12.47.5446LD_11_Cnt_Saw2_CutStart 
428.06.2024 13.06.1546LD_11_Cnt_Saw2_CutStart 

 

time.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors