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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Analitika
Post Prodigy
Post Prodigy

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

I need to crete filter by week ranges

 

Analitika_0-1598429845010.png

Now 

Range = 

 
var Year1 = 'Date'[Date].[Date]
var Year2 = INT('Date'[Year])
VAR conc= ROUNDDOWN(DIVIDE('Date'[WeekN]-1,4),0)
var WeekS= format(if(conc=0, 1, conc*4+1),"#")
var WeekEnd= format(CALCULATE((conc+1)*4),"#")
return
WeekS & "-" & WeekEnd

 

 

but when i select whool range i got error in visuals or do not showing info at all

 

Error Message:
MdxScript(Model) (332, 13) Calculation error in measure 'DK'[rate %]: An argument of function 'DATE' has the wrong data type or the result is too large or too small.

 

 

rate % =
var earnings= [LY]
VAR midC= MAX('Date'[Date])
var midC2= date(year(midC)-1,MONTH(midC),DAY(midC))
var stock1 = CALCULATE(sum([sum]), FILTER(ALL('Date'[Date]),'Date'[Date]<=midC))
var stock2 = CALCULATE(sum([sum]), FILTER(ALL('Date'[Date]),'Date'[Date]<=midC2))
VAR new= DIVIDE(earnings,stock2 )
var old= DIVIDE([CountS],stock1 )
RETURN

FORMAT((new-old),"0.00%")
7 REPLIES 7
Icey
Community Support
Community Support

Hi @Analitika ,

 

Please let me know if the link I post above is helpful.

 

 

Best Regards,

Icey

TY, your post is not helpful

amitchandak
Super User
Super User

@Analitika , rate %  seems correct. Unless there is an error Range. Can you check them separately.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

error only if whoole group of week select, if selected week separately everithing work

All looks ok , are you using date in measures of [LY] or [CountS] seems like problem happening at these measures.

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




countS =
ROUND (
    CALCULATE (
        CALCULATE ( SUM ( [sum2] ) ),
        FILTER (
            'T1',
            'T1'[Table] = "t"
                && NOT 'T1'[item] IN { "1", "2", "3" }
        )
    ),
    0
)

 

LY = CALCULATE ([countS], dateadd( 'Date'[Date],-1,YEAR))

 

 

No matter which measure,  every measure return empty if whoole weeks range selected, and return sums if selected separetly weeks

Icey
Community Support
Community Support

Hi @Analitika ,

 

Please check if this post helps:

An Argument of Function Date has wrong data type or result is too small or too large Error

 

In addition, are [sum] and [sum2] measures? If they are, need to use SUMX inteading of SUM function.

 

 

 

Best regards

Icey

 

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

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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