Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
93 | |
86 | |
80 | |
69 | |
68 |
User | Count |
---|---|
226 | |
129 | |
119 | |
83 | |
77 |