Forum Discussion

shhush's avatar
shhush
Frequent Visitor
6 years ago
Solved

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!

5 Replies

  • 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.

    • shhush's avatar
      shhush
      Frequent Visitor

      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.

      • Nathaniel_C's avatar
        Nathaniel_C
        Community Champion

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