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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Calculate Totals Are Incorrect

I'm using the following DAX to get the 'Quantity_On_Request' for the same day last year.  When I view the data in a table, the totals are correct by day, however the total is incorrect.  

I don't undertand why the 'total' is incorrect, but but the daily numbers are.  

 

PrevYear Demand Qty = CALCULATE(SUM(Billed_Order_Details[Quantity_On_Request]),DATEADD('Order Date'[Date],-1,year))

3 REPLIES 3
Anonymous
Not applicable

Hi 

I will create a calculated measure using the following:

CALCULATE(SUM(Billed_Order_Details[Quantity_On_Request]), SAMEPERIODLASTYEAR('Order Date'[Date]))

Hope this help

Tomas

 

Anonymous
Not applicable

Hi Tomas

 

Thanks for the reply, but using 'SamePeriodLastYear' gives me the same results.  See below, this is what shows on the 'Totals' line of the Table visual.  The daily totals are correct, but it's the 'Total' thats now summing correctly.

 

Date               PrevYear Demand Qty
11/12/2019    54,959
11/13/2019    48,124
Total               741,722

Anonymous
Not applicable

Sorry, I mistyped, it's the 'Total' line that's summing incorrectly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.