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
Anonymous
Not applicable

DAX: 12 month rolling with blanks

 

 

Hi,

I am not proficient user in DAX so I ask your support.

I calculated the 12M as follows:

 

12MR = calculate(
sum(Sales[Or Sales Eur]);
datesinperiod(Calendar[YMD];lastdate(Calendar[YMD]);-12;MONTH)
)

 

Basically it works well but if I divide the data in categories, if one category is zero in a specific month (so it is blank), the 12M calculation gets me zero instead of the sum of the previous 12 months. Could you help me? Thanks

esempio.jpg

1 REPLY 1
Anonymous
Not applicable

That's pretty much impossible. It looks like you just don't have any sales in the last 12 months for the months that report 0.

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.

Top Solution Authors