0

I am trying to calculate the number of days between two columns. Below is an expression in qlik sense that I would like to translate into DAX:

LPO_DATE - (CLM_INTM_DT) +1

I tried this in DAX but I don't think it is correct:

V_TurnAround_Time =
CALCULATE ( SUM ( LPO_excel[LPO_DATE] ) )
    - CALCULATE ( SUM ( Claims_excel[CLM_INTM_DT] ) ) + 1
scjorge
  • 169
  • 1
  • 12
MIRROR
  • 61
  • 1
  • 2
  • 10
  • What result are you getting with this? Is this a measure or a column? – Pratik Bhavsar Jul 15 '19 at 10:07
  • LPO_Date and CLM_Intm_DT is columns – MIRROR Jul 15 '19 at 11:45
  • 1
    I believe you overcomplicate things, when you need an extra column, you can write: V_TurnArount Time = LPO_excel[LPO_DATE] - Claims_excel[CLM_INTM_DT]. Note: you need a 1:1 relation between your tables.. – Aldert Jul 15 '19 at 11:55
  • when i try this this shows an error "Cannot find name" and red underline on both columns – MIRROR Jul 15 '19 at 12:03
  • 1
    @Aldert is correct. You are either creating a measure, not a column or (which is more likely) you are working with multiple tables, which have no relationships between them. Provide sample data so we can help you further or check https://learn.microsoft.com/en-us/dax/related-function-dax – Pavel Klammert Jul 15 '19 at 12:28
  • can you post a shot of your model ? – StelioK Jul 15 '19 at 22:31
  • this is link model. https://www.dropbox.com/s/52j0s8rn0ze0mci/Claims_test_model.pbix?dl=0 .. in this please check variables table and in that check v_TurnAround_Time measure .. – MIRROR Jul 16 '19 at 05:19
  • @StelioK ....... – MIRROR Jul 16 '19 at 05:56
  • @Pavel Klammert – MIRROR Jul 16 '19 at 05:56
  • @Aldert......... – MIRROR Jul 16 '19 at 05:56
  • 2
    Please be aware that we are working in different timezones and that this is a site where there are zero commitments (all free of charge). It is considered rude when you start pushing others for answers. I will have a look later. – Aldert Jul 16 '19 at 05:58
  • oh sorry for this .. and yes please check model and let me know – MIRROR Jul 16 '19 at 06:58
  • after looking at the model and the columns, I have to ask what is it, that you want to accomplish actually? Both the columns are dates and subtraction might do something different, then you expect. Because simply using your formula, I get list of dates in the year 1900 and I doubt that is what you are after – Pavel Klammert Jul 16 '19 at 07:44
  • i am trying to get days – MIRROR Jul 16 '19 at 08:20
  • any solutions ?? i am trying to get just different between two days and want days – MIRROR Jul 16 '19 at 08:37
  • I think you are looking for this https://dax.guide/datediff/ But be carefull with relationships. If you using two tables it will be different a solution of a new column in many side than solution of new column in one side. – ibarrau Jul 19 '19 at 19:44

0 Answers0