Forum Discussion

Lurian's avatar
Lurian
New Member
1 year ago

Error deleting DAX measures

Hello, I have a problem with a dashboard I developed and I haven't been able to find a solution yet. Basically, the error is caused by 3 measures that I created within a table of measures.

These measures used Parameters that I ended up deleting as I developed the dashboard, but the measures remained in the file.

So far, it seems simple, but when I try to delete these measures, I can't and the following error appears:

 

"An argument of the 'DATE' function has the wrong data type or the result is too large or too small."

 

I've tried several ways to delete these measures, but I can't because it always generates this error. Also, if I try to update the data source, I can't because the error persists.

 

(Notes: When I access the Power Query editions, no error is generated. I've also checked the other tables and Measures and everything is correct)

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Lurian

     

    Thank you very much saud968 for your prompt reply.

     

    The error you're encountering, "An argument of the 'DATE' function has the wrong data type or the result is too large or too small," typically occurs when the DATE function is given an invalid argument, such as a non-date value or an out-of-range date.

     

    Here are a few steps you can try to resolve this:

     

    Check the Measures: Ensure that the measures you are trying to delete do not reference any invalid or non-existent parameters. Since the parameters were deleted, the measures might be referencing something that no longer exists.

     

    Update the Measures: Temporarily update the measures to use valid date values or default values. For example, you can replace the problematic DATE function with a hardcoded date to see if that allows you to delete the measure.

     

    Use SELECTEDVALUE: If the measures are using variables that depend on context, try using SELECTEDVALUE to provide a default value.

     

    Remove Dependencies: If possible, remove any dependencies on the problematic measures from other parts of your model.

     

    As a last resort, you can try exporting your data model, removing the problematic measures in a text editor, and then re-importing the model.

     

    Regards,

    Nono Chen

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