Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RMV
Helper V
Helper V

mdxscript(model) (145,206)

Hi,

 

I have this graphic that shows error if I set my month slicer to 10-12, but it works perfect if I set month slicer below 10.

I'm using the same value used in the graphic for some other graphic, and it works fine.

The error message is:

"Can't load the data for this visual

MdxScript(Model) (145, 206) Calculation error in measure 'Table'[Amount]: An argument of function 'DATE' has the wrong data type or the result is too large or too small."

 

 

The formula I'm using:

Amount PY = CALCULATE(SUM(Table[Amount]),FILTER(ALLSELECTED(Table),AND(Table[Transaction Date]>=DATE(YEAR(TODAY())-1,1,1),Table[Transaction Date]<=DATE(YEAR(TODAY())-1,MONTH(MAX(Table[Transaction Date])),DAY(MAX(Table[TransactionDate]))))))

 

This is the result if I set the month slicer = 12, where the error occurred

option 11.jpg

 

This is the result if I set the month slicer = 9 which show the result perfectly

option 11.jpg 

 

This is the result if I set month slicer to 12, for another category (in this example: 09"), the graphic shows the value fine.

The graphic works well too for the other categories.

option 9.jpg

 

Hope that anyone can advise me on what caused the error and how to rectify it.

Thanks before.

 

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@RMV,

 

You may try adding calculated columns instead of selecting Date Hierarchy.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chuncz-msft,

can you give example, please?

@RMV,

 

I just meant the following.

Capture.PNG

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chuncz-msft,

 

I don't use Date Hierarchy for the axis in the graph.

I added a column with Month formula to return the month no. only.

 

What does this error mean actually, and what is the cause of the error?

@RMV,

 

Show us a complete example with dummy data so that we might find a workaround.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.