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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
AlessandroBet
Helper V
Helper V

TOTALYTD

Hi,

 

i'm tring to work with TOTALYTD but it occurs an error on date parameter.

My date format is like the picture this 

 

 Immagine 2021-04-22 161547.png

 

but it needs the following [date] format

 

Immagine 2021-04-22 161754.png

 

I cant change anything because my table came from an existing dataset.

Can I convert the date format with DAX command in order it works correctly?

1 ACCEPTED SOLUTION

@AlessandroBet

could you please provide the sample data and expected output?





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@AlessandroBet 

do you have a datetime table?

https://docs.microsoft.com/en-us/dax/totalytd-function-dax

maybe you can try

measure =

VAR _maxdate=max(Sales[date])

return sumx(FILTER(all(sales),Sales[date]=year(_maxdate)),Sales[Sales])





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

Proud to be a Super User!




thanx but please help me with teh following code 

The mistake is at red text

 

IF(
    ISFILTERED('Opportunities'[Actual Close Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    TOTALQTD(
        SUM('Opportunities'[Actual Won Sales Price_Base]), 
        'Opportunities'[Actual Close Date]
    )
)

@AlessandroBet 

maybe you can try to create a datetime table and change the red part to datetime date key





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

Proud to be a Super User!




I can't create tables because i have created a report starting form existing dataset 

@AlessandroBet

could you please provide the sample data and expected output?





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

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.