March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Guys appreciate this may not have been the best way to setup the data initially but in have invoice data spanning several years. I have a DCalander table an linked the 2.
From then I created hard coded measures to calculate the revenue for the this current year as
and the Previous year as
However I have been now asked to increase the functionality such that for any selected year selected in filter(DCalander) the revenue data would show the selected year (as current year) and prior year values acordingly.
Appreicaiate any advice on how to redefine my revenue measures to make this possible.
With best regards
Gareth
Solved! Go to Solution.
@Gareth_Hunt
With the above formulas, once you selected the Year in the slicer, the measures should only sum the selected year revenue for the first measure, and sum the previous year revenue of the second measure. Additional calculation is not required.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Gareth_Hunt
I guess you need add All(Table) to the filter for previousyear measure.
SumRevenue = SUM(InvoiceData[Revenue])
PreviousYrSumRevenue = CALCULATE([SumRevenue], PREVIOUSYEAR(DCalendar[Date]),All(DCalendar))
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If the InvoiceData is related to the date dimension correctly, this looks like 2 measures are required
SumRevenue = SUM(InvoiceData[Revenue])
PreviousYrSumRevenue = CALCULATE([SumRevenue], PREVIOUSYEAR(DCalendar[Date])
Hi thank you for your feedback, the issue i have is that the total revenue sums all revenues for both years
should I then calculate the year selected as being this year = SUM revenue-LYrevenue?
@Gareth_Hunt
With the above formulas, once you selected the Year in the slicer, the measures should only sum the selected year revenue for the first measure, and sum the previous year revenue of the second measure. Additional calculation is not required.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |