Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys,
I create a calendar table, created a relationship with the data and used:
Solved! Go to Solution.
[Total Data] = SUM('Data Export'[Data])
LY Number =
var __lastDate =
CALCULATE(
max( FactTable[Date] ),
All( FactTable)
)
var __currentPeriodAdjusted =
FILTER(
VALUES( Dates[Date] ),
Dates[Date] <= __lastDate
)
var __result =
CALCULATE(
[Total Data],
SAMEPERIODLASTYEAR(__currentPeriodAdjusted)
)
return
__result
Best
D
[Total Data] = SUM('Data Export'[Data])
LY Number =
var __lastDate =
CALCULATE(
max( FactTable[Date] ),
All( FactTable)
)
var __currentPeriodAdjusted =
FILTER(
VALUES( Dates[Date] ),
Dates[Date] <= __lastDate
)
var __result =
CALCULATE(
[Total Data],
SAMEPERIODLASTYEAR(__currentPeriodAdjusted)
)
return
__result
Best
D
Many thanks, this worked!
Perhaps check out one of the other time intelligence functions, you may find one that is suitable. Or, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
20 | |
18 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |