Hello everyone, and thanks in advance for any and all help you can provide. It is very much appreciated!
I’ve been pulling my hair out all day on this one. I’ve tried to research the question, and saw some on-line resources that referenced including HASON Filters and some other fixes. However I can’t seem to get anything to work correctly.
Summary:
I’m trying to calculate Year-Over-Year Price Increases at a transactional level (i.e. Product # per Sales Transaction level), and then be able to aggregate this up for a SalesPerson and Region. I am trying to exclude any Product # that has not had any Sales in the Previous year.
Background:
I have a Sales Table, called (order_history) , as well as a Date Table called (calendardatetable) . I have a large number of Measures built off of these tables, with the pertinent ones being the following and the last one that’s giving me the problem:
So basically, what I’m trying to do is Calculate the Price Differential on items that were sold in the Current Year and in the Prior Year, and apply that YoY Average Price to the Current Year Quantity Sold. I don’t want to include in the calculation items that were sold in the current year but not last year (which would yield a large Positive number) or those that were sold last year but with no Sales in the current year (which would yield a large Negative number).
So I’m sure that the experts out there already can guess what is happening: my DAX formula is accurately being applied to both the Rows (which I want it to do) and the total (which I don’t want it to do). In the screenshot below, it’s the 4th column over titled [CY Qty Extended YoY Price Differential] that’s the problem. I need this Total to show -$3,319.22, not the $51,223.40 that it is currently calculating independently of the row results.
Hi JDiOrio, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.
When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.
Firstly, it’s always helpful when working or mock-up PBIX file is provided for the reference so that members of the forum can assist you in a better and efficient manner. Without which it’s just a guess work for the members and consumes their time.
Now, coming back to the solution part. You can use the measure as provided below for the reference -
I’m also providing a link below which one of our expert @Greg had created onto the forum which specifically addresses this type of issues pertaining to the fixation of the totals.
Hoping you find this useful and helps you in solving the problem that you’re facing.
Note:
1). In the above formula, it’s presumed that “customer_description” field is from the Sales table i.e. “Order_History” table and “Year” is from the Date table i.e. calendardatetable.
2). Please adjust the naming conventions accordingly in your file. I’ve used the naming conventions based on the information provided into the post.
3). To view the entire post pertaining to “Fix Incorrect Totals”, please click onto the link and not onto the “expand/collapse” button.
3). If this doesn’t solve the requirement than please post a working or mock-up PBIX file so that members can assist you further.
Thanks for the reply @Harsh …very much appreciated! I’m afraid that I wasn’t able to get the above solution to work, however someone else pointed me towards the following, which seemed to work:
I’ll have to read in more detail either how to mask the PBIX data prior to sharing or else next time I’ll try to mock something up from a PBIX perspective. I know that would have helped ALOT
Ok @Harsh, I may have spoken too soon when I said that the fix that someone else pointed me towards worked. Going back to your solution (shown below), the problem that I’m running into is that Power BI doesn’t seem to let me reference the name of the measure in line 8 that is also the name of the measure that I’m writing the formula for. I’m not sure if I’m explaining that correctly, but do you know what I mean?
Firstly, you’re posting the query on a closed thread. I request you to please create a new thread for your query now.
Also as was suggested earlier, that without PBIX file it’ll just be a guess work for the forum members to assist you. Please provide the PBIX file so that forum members can assist you in a better and efficient manner.