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
NoobSpartan
Frequent Visitor

Sum Daily units based on values present this and last year

Hello World,

Here is what I am trying to attempt

  • by day by location sum units per day where this year is not null and greater than 1000 and last year is not null or greater than 1000.

I have this measure to start: Volume CY LFL = sumx(VALUES('BP Fuels West - Sold Daily LFL'[SUM_of_SalesQuantity]),if([Volume CY]<1000,0,[Volume CY]))

This returns me the correct sales this year only not looking at last year at this point

next is last year: Volume PY LFL = if(sumx(VALUES('BP Fuels West - Sold Daily LFL'[SUM_of_SalesQuantity]),if([Volume CY]<1000,0,[Volume CY]))=BLANK(),0,[Volume PY])

This returns a zero in the volume last year as a zero but the total is incorrectly adding [volume PY]

I have been trying different ways to get the sums correct as the graphics looks as expected volume by day excluding null or short days. I feel like I am missing a step. 

JiC : Volume PY = CALCULATE([Sold Volume],SAMEPERIODLASTYEAR('Calendar'[Date]))

any help or direction would be greatly apprecited.

thanks community

 

Daily LFL.png

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @NoobSpartan,

 

If I understand your scenario correctly that you could calculate the Volume CY LFL but you have problems with calculating the Volume PY LFL ?

 

If it is, please share some data sample which could reproduce your scenario and your desired output so that we could help further on it.

 

Best  Regards,

Cherry

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

of course, TY Cherry

I added excel sheet and notes

Columns A-C are how my data is built. The remaining columns mimic my measures and the totals at the bottom show my results vs my expected/correct results.

I aoplogize. I cant share while at work from my onedrive outside my organization.LFL Daily view excel.png

 

 

 

 

 

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.