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
shhush
Frequent Visitor

Using Sumproduct for timestamps - please help!

I am trying to use this sumproduct formula from Excel in my PowerBI report, but it is giving me an error that DAX comparisons don't support values of type Text with values of type Number. I am trying to compare start timestamps and stop timestamps and see if there is any overlap. The formula from Excel is "=SUMPRODUCT((A2<enddate)*(B2>=startdate))>1" and returns True or False. I have tried using SumX in its place and that's when I get an error to use the VALUE or FORMAT function to convert the value but I want it to stay as a timestamp.

How come Excel is smart enough to see the data as a date type and calculate it but PowerBI cannot? Or am I missing something?

 

Any help is appreciated. Thanks!

1 ACCEPTED SOLUTION

One issue is that it appears your dates are stored as text.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Nathaniel_C
Super User
Super User

Hi @shhush 
Not sure what you are trying to do in Power BI, if you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

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

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I have attached a sample .pix file here. I have two tables - one with clock ins/outs from one system, and another with clock ins/outs from another system. I'd like to see if there are any overlapping times. I have combined the tables to see if I could create a measure that would let me know if there are other date/times that are overlapping, but need some guidance.

One issue is that it appears your dates are stored as text.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




 I honestly thought I had checked that, but didn't check the other table. Thank you!

parry2k
Super User
Super User

@shhush In power Bi you cannnot compare different data type as you define the data type of each olumn and seems like that is the case. If you share how does your data looks like with data type and what you are trying to achieve, it will help to get you the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.