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
Hi
I've asked the question before and it got solved. I'm not replicating the solutions and I can't get it to work.
I have a sales table with sales recorded from 01/01/2022 to 01/04/2023. I've created a data table with the same range and created a relation between the 2.
I can pull off current year sales not a problem. When I try to create previous year sales it's totalling the full month of april last year as well when it should be 01/01/2022..01/04/2022
It should be 84k but it's returning 120k.
I've tried the following
Sales PY (£) =
CALCULATE(SUM(SalesDashboard[SalesAmountActual]),SAMEPERIODLASTYEAR('Date'[Date]))YTD LY (limited by last date in Data table) =
VAR DataMaxDate =
CALCULATE ( MAX ( 'Date'[Date] ), ALL ( SalesDashboard ) )
RETURN
CALCULATE (
[YTD],
SAMEPERIODLASTYEAR (
INTERSECT (
VALUES ( 'Date'[Date] ),
DATESBETWEEN ( 'Date'[Date], BLANK (), DataMaxDate )
)
)
)Any suggestions?
@Anonymous Try Better Year to Date: Better Year to Date Total - Microsoft Fabric Community
@Anonymous
Please try this modified version :
YTD LY (limited by last date in Data table) =
VAR DataMaxDate =
CALCULATE ( MAX ( 'Date'[Date] ), ALL ( SalesDashboard ) )
RETURN
CALCULATE (
[YTD],
SAMEPERIODLASTYEAR (datesytd('Date'[Date])), all(dimdate[Date])
)
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
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 |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 39 | |
| 35 | |
| 23 |