Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hopefully after seeing my code and my examples, this question will speak for itself as I am not sure how to word it.
So GMDollars LY is simply the Last Year's sales and it works perfectly. Gross Margin v2 was simply a measure I created from a Calculated column in order to use it in the Sales Last Year Only Measure since I couldn't use a Calculated Column or an Original Column. (Maybe this is where my problem is stemming from.) (Also, I do want grand totals of the sums of each column)
GMDollars LY = CALCULATE([Gross Margin v2], SAMEPERIODLASTYEAR(rpt_SalesHistoryMAST[GLPostDate].[Date]))
Gross Margin v2 = SUM(rpt_SalesHistoryMAST[Gross Margin])
Sales Last Year Only = VAR GMD = [GMDollars LY] VAR GMV2 = [Gross Margin v2] RETURN CALCULATE(GMD, FILTER(rpt_SalesHistoryMAST, GMD <> BLANK() && GMV2 = BLANK()))
The first picture below is what I want to happen, and the second picture is what is actually happening with my data. I have tried a lot of solutions and ended up with Circular Dependency issues or just no calculations whatsoever. I can get the Sales Last Year Only column to come out correctly but then it will not give me the total sum at the end of the column and that is the one requirement of this project.
What I want it to give:
What it actually gives:
Hi @mbenn,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
Hi @mbenn,
Can you share the original data, please? We can't check the formulas based on the result.
The solution could be adding one filter condition of Year.
Sales Last Year Only = VAR GMD = [GMDollars LY] VAR GMV2 = [Gross Margin v2] RETURN CALCULATE(GMD, FILTER(rpt_SalesHistoryMAST, GMD <> BLANK() && GMV2 = BLANK()&&[Year] = year(today()) - 1))
Best Regards,
Dale
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
87 | |
81 | |
53 | |
37 | |
35 |