Forum Discussion

nor303's avatar
nor303
Helper III
2 years ago
Solved

Date problem with formula - LASTDATE

Hi

 

This problem is driving me nuts, everything seems to be in order but the formula wont work. Ive tried different formats, checked options etc. Nothing helps. Anyone have an idea why the measure wont filter the data from 31.12.2023?

Thx!!!

And now I cant even upload the pbix file.... where is the button?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,  nor303
    The error message "PARAMETER IS NOT THE CORRECT TYPE" usually indicates that the function is receiving an argument of a type that it does not need.

     

    In your case, the problem may be with the function. This function requires a string as an argument, but it doesn't seem to be a string. If it's already a date, you don't need to use it.
    You can try to modify your DAX expression as follows:

     

     

     

     

    Saldo Siste Måned = 
    CALCULATE(
        SUM('Qlik AGH (2)'[Saldo lån/kreditter]),
        FILTER(
            'Qlik AGH (2)',
            'Qlik AGH (2)'[Periode] = MAX('Qlik AGH (2)'[Periode]) &&
            'Qlik AGH (2)'[LTV] = "LTV"
        )
    )

     

     

    I don't know what this [Saldo lån/kreditter] is, so I'll calculate it according to your existing column [Saldo ] above. I hope this will help you.

     

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

5 Replies

  • PeriodeSaldo LTV
    01.12.20235 LTV
    01.12.20236 LTV
    01.12.20237 LTV
    01.12.20238 LTV
    01.12.20235 LTV
    01.12.20234 LTV
    01.12.20236 LTV
    01.12.20237 VTL
    01.12.20239 VTL
    01.12.20232 VTL
    01.12.20234 VTL
    01.12.20234 VTL
    01.12.20234 VTL
    01.12.20239 VTL
    01.12.20238 VTL
    01.12.20234 VTL
    01.09.20235 LTV
    01.09.20236 LTV
    01.09.20237 LTV
    01.09.20238 LTV
    01.09.20235 LTV
    01.09.20234 LTV
    01.09.20236 LTV
    01.09.20237 VTL
    01.09.20239 VTL
    01.09.20232 VTL
    01.09.20234 VTL
    01.09.20234 VTL
    01.09.20234 VTL
    01.09.20239 VTL
    01.09.20238 VTL
    01.09.20234 VTL

     

    Im sorry for not given this the right format. I dont why the date and the saldo column merge when I paste the data.

  • Saldo last month =
    CALCULATE(
        SUM('DAto'[Saldo]),
        FILTER(
            'DAto',
            'DAto'[Periode] = LASTDATE('DAto'[Periode]) &&
            'DAto'[LTV] = "LTV"
        )
    )

    My formula works with the text filter "LTV" but I get the total for all rows that includes LTV. Also 30.09.2023. I have also tried to use SUMX, but it gives the same answer for me.
  • Ive found this Solution:

    Saldo Siste Måned =
    CALCULATE(
        SUM('Qlik AGH (2)'[Saldo lån/kreditter]),
        FILTER(
            'Qlik AGH (2)',
            DATEVALUE('Qlik AGH (2)'[Periode]) = LASTDATE(DATEVALUE('Qlik AGH (2)'[Periode])) &&
            'Qlik AGH (2)'[LTV] = "LTV"
        )
    )
    However I get a red underline and it says: PARAMETER IS NOT THE CORRECT TYPE. 
    Can it be something with regional settings or something? And if so how do I correct it?
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,  nor303
      The error message "PARAMETER IS NOT THE CORRECT TYPE" usually indicates that the function is receiving an argument of a type that it does not need.

       

      In your case, the problem may be with the function. This function requires a string as an argument, but it doesn't seem to be a string. If it's already a date, you don't need to use it.
      You can try to modify your DAX expression as follows:

       

       

       

       

      Saldo Siste Måned = 
      CALCULATE(
          SUM('Qlik AGH (2)'[Saldo lån/kreditter]),
          FILTER(
              'Qlik AGH (2)',
              'Qlik AGH (2)'[Periode] = MAX('Qlik AGH (2)'[Periode]) &&
              'Qlik AGH (2)'[LTV] = "LTV"
          )
      )

       

       

      I don't know what this [Saldo lån/kreditter] is, so I'll calculate it according to your existing column [Saldo ] above. I hope this will help you.

       

       

      How to Get Your Question Answered Quickly 

      If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

      Best Regards

      Yongkang Hua

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

       

       

       

  • Hi nor303 ,

     

    Option to upload is not available to everyone (prolly in the future). Alternatively, you can post a link to a cloud storage.