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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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