Hello! I have used this formula in dozens of examples but for whatever reason it is not working for this example.
I will try to explain this as best possible. I have a data source that I receive that has a date column called "Last Seen On". This is a count of inventory table, so if a product was last in stock on December 10th, thats the date that that will be in "Last Seen On".
From there, I connected that date to a date table so that i can quickly filter by month, quarter, year, etc.
So here is my dilemma. I want to measure the rolling 2 months inventory of a SKU. So using the above example, a product was last seen in inventory on December 10th. If i use January 2023 as my filter, then i should see the inventory of December 2022 and January 2023. Example below.
The measure i am using (and have used dozens of time before) is ;
Thank you, but the same outcome as previous two methods. My best guess is that there is either a problem with my date hierarchy, or that it is having a challenge handling data with no records (There is no January records of this dataset, so when i select january for R2M, it shows null)
In your case, the total is calculated based only on the current value and the immediately preceding value.So in Feb 22, it is adding The value of Feb 22 and Jan 22, which are both 0 and therefore you get 0 as the result
Hi Pady, i show in my example above. I am trying to pull Jan 2023 rolling 2 months inventory.
December 2022 had 9 units
January 2023 has 0 units
R2M result should be 9. I have now solved my challenge, somehow my date table had duplicates so the relationship created was incorrectly created as Many to Many. Solved by removing duplicates and changing to Many to One
Hi @Greg_Deckler , thanks for sharing but i am looking for the total sales during that time, not just the average. Would your variable still work for that?
@dswinden Sure, just use SUMX instead of AVERAGEX, regardless the rolling part is the same.
Thanks for the help! I attempted this modifying for my fields (below) but do not get the result i need.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.