business
2 TopicsDAX Measure that accounts for previous dates data and not future dates data based on current date
Hello everyone, I am working on a financial report that is connected to an excel document full of referenced data. In Power BI desktop, I am hoping to display the average COGS per day (Cost of Goods Sold) in the form of a PBIX card on a Year to Date scale. Chronologically speaking, the data is organized by week (Mon-Sun). I have references set up in excel to capture future data as it occurs for this year. Below is an example mockup to better visualize my data/request: The issue I am having here is that the average COGS/day is taking into account future weeks where the data is evidently zero. For instance, today's date is 7/21, so all future weeks (weeks of 7/25, 8/1, etc.) are being included in this average and are therefore skewing this metric. I am hoping to write a measure that only accounts for weeks prior to the current date. Any help/tips on my ask would be very appreciated! Thank you in advance.Solved1.3KViews0likes6Comments7 day moving average
I really have zero DAX experience. I even tried to add a column and then enter an Excel formula at first. Of course after digging in a little I realized that it doesn't work that way in this case. I am using direct query from a SQL database. My query data looks like the below table - and I am trying to add the final 7 day moving average column. In short, I need to sum the quantity ordered on each date and then calculate the 7 day moving average on those sums. I would then add that data to the line graph below. What is the best way to go about doing this? In addiiton, is there a particular trainng course I can take to come up to speed?Solved6.7KViews0likes4Comments