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
robofski
Resolver II
Resolver II

TOTALYTD (and other Time Intelligence) not working as expected

Simpe formula:

Total Sales YTD = TOTALYTD(sum(VW_PowerBI_Analysis[NetSales]),DimCalendar[Date])

 

DimCalendar has contigious dates joined to Ship Date DMY in VW_PowerBI_Analysis one to many, one way filtering.

 

Ship Date DMY is a caculated column in the model as the data only has yyyymmdd fields:

ShipDate DMY = DATEVALUE(mid(VW_PowerBI_Analysis[ShipDate],5,2)&"/"&right(VW_PowerBI_Analysis[ShipDate],2)&"/"&left(VW_PowerBI_Analysis[ShipDate],4))

 

I have also tried with a field created in the Query Editor and set as Data Data type.

 

I'm expecting a sum of Netsales from Jan 1 2017 up to the last date of 2017 avalaible in my dataset but I'm getting Blank, Nada, Nothing!

 

I'm sure I'm missing something obvious but everything I'm reading says this should work but it's not!

 

Any suggestions?

 

Dan

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @robofski

What type of visual do you create? You would need to add filter for the measure to return values. For example, if you create a table visual, add year column in the table visual. If you create a card visual, it will return correct value when you add a slicer to filter the Card, there is a example for your reference.


1.PNG

 


4.PNG5.PNG

Alternatively, create a calculated column using the following formula, the column should return values after you add it to your card visual even if you don't user slicer.

Column = TOTALYTD(sum(VW_PowerBI_Analysis[NetSales]),DimCalendar[Date])

 

Thanks,
Lydia Zhang

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

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

Hi @robofski

What type of visual do you create? You would need to add filter for the measure to return values. For example, if you create a table visual, add year column in the table visual. If you create a card visual, it will return correct value when you add a slicer to filter the Card, there is a example for your reference.


1.PNG

 


4.PNG5.PNG

Alternatively, create a calculated column using the following formula, the column should return values after you add it to your card visual even if you don't user slicer.

Column = TOTALYTD(sum(VW_PowerBI_Analysis[NetSales]),DimCalendar[Date])

 

Thanks,
Lydia Zhang

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

@v-yuezhe-msftLydia, I think I have it!  I was filtering with a field in my Fact table not in the calendar table, your post made me think harder so it was the solution!  Thank you.

@v-yuezhe-msftI wish I could say it works but it doesn't!  See screen capture below showing the DAX formulas too.

Capture.JPG

As I've selected 2017 in the filter I would expect Total Invoiced sales and YTD to be the same but Prior YTD should be different!

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.