Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello everyone,
I have a financial fact table which contains the columns accounting_date, CC, realized_amount.
I calculated the amount realized by doing sum(finance[amount_realise]) and an amount realized N-1 by doing CALCULATE(SUM(finance[amount_realise]),SAMEPERIODLASTYEAR('Dim Date'[Date]))
I can decline the amount realized and the amount realized n-1 per year, month and CC.
I remind you, we have a date dimension which is linked to the finance fact table through the accounting_date and date column of the date dimension.
An example: when I put the amount realized by CC in a table, the amount realized is indicated up to a given month and the amount realized N-1 over the whole year (which I find normal) Now I would like to calculate an cumulative amount N-1 depending on the amount realized, that is to say if for example for the year 2024 we have the amount realized in the finance table which is entered until June, I would also like to have a measurement amount realized N- 1 which will be the cumulative amount of the previous year until the month where we have the realized amount entered or when we select the month filter example April that realized amount N-1 is accumulated until the selected month.
Thank you all for your responses
Solved! Go to Solution.
Hi @alsolok ,
Check if this blog post and video can help you:
https://www.sqlbi.com/articles/previous-year-up-to-a-certain-date/
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @alsolok ,
Check if this blog post and video can help you:
https://www.sqlbi.com/articles/previous-year-up-to-a-certain-date/
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you
@alsolok , For this requirement make sure you have one date table , then create measures
AmountRealized = SUM(finance[realized_amount])
AmountRealizedN1 =
CALCULATE(
SUM(finance[realized_amount]),
SAMEPERIODLASTYEAR('Dim Date'[Date])
)
CumulativeAmountRealizedN1 =
VAR CurrentYear = MAX('Dim Date'[Year])
VAR CurrentMonth = MAX('Dim Date'[Month])
RETURN
CALCULATE(
[AmountRealizedN1],
FILTER(
ALL('Dim Date'),
'Dim Date'[Year] = CurrentYear - 1 &&
'Dim Date'[Month] <= CurrentMonth
)
)
Proud to be a Super User! |
|
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 64 | |
| 39 | |
| 33 | |
| 23 |