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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Roseventura
Responsive Resident
Responsive Resident

Store Results of a measure without results being attached to the dates that helped calculate it.

This is a very strange one, but I've actually had to deal with this issue several times and I'm not sure how to do it.

 

This is a DAX problem, but I'm going to use Excel to illustrate:

 

I need to calculate Average Sales by WEEK over 3 previous quarters.  My fiscal calendar has 13 weeks; we're on a 4-4-5 fiscal calendar so there are 13 weeks in each quarter.  I have this measure and it works well.

 

My problem is this:  I need to take the average for week 12 for the previous 3 quarters (which is $712,616) and display it in the current month.  When I try to do this, I get 0's, because the measure is only going to show the values for week 12 for each of the actual quarters where the sales occured (2017-Q4 12/24-12/30, 2018-Q1 3/18-3/24, 2018-Q2 6/17-6/23).

 

I need to take that weekly avarege $712,616 and save it so it's not attached to the dates that helped calculate it and show it in the current month.  See below.

 

I tried creating a separate date table, but it got very messy and ultimately couldn't get it to work.

 

Any suggestions?

 

Capture3.JPG

 

 

1 ACCEPTED SOLUTION

I think I solved the problem. As soon as I realized that I had to treat this the same as a “rolling month”, I was able to make it work. Here is my measure:

 

Current Rolled Book Ship Estimate = CALCULATE([Current Book Ship Estimate], FILTER(ALL(PBI_FSCAPF), (PBI_FSCAPF[LUDATE] <= MAX(PBI_FSCAPF[LUDATE]))))

 

where PBI_FSCAPF is my DATE table and [LUDATE] is my DATE field.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Roseventura,

 

Can you please share some sample data to test and coding formula?

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I think I solved the problem. As soon as I realized that I had to treat this the same as a “rolling month”, I was able to make it work. Here is my measure:

 

Current Rolled Book Ship Estimate = CALCULATE([Current Book Ship Estimate], FILTER(ALL(PBI_FSCAPF), (PBI_FSCAPF[LUDATE] <= MAX(PBI_FSCAPF[LUDATE]))))

 

where PBI_FSCAPF is my DATE table and [LUDATE] is my DATE field.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.