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.
(pic 2)
Solved! Go to Solution.
Hi @Kim_Sky ,
According to your description, I create a sample.
Electrical table:
Calendar table with its week num.
Here's my solution, create a measure:
Previous Week Electricity =
IF (
ISINSCOPE ( 'Calendar'[Week Num] ),
CALCULATE (
SUM ( Electrical[Value] ),
'Calendar'[Week Num]
= MAX ( 'Calendar'[Week Num] ) - 1
),
CALCULATE (
SUM ( Electrical[Value] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = MAX ( 'Calendar'[Date] ) - 7 )
)
)
Get the correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Kim_Sky ,
According to your description, I create a sample.
Electrical table:
Calendar table with its week num.
Here's my solution, create a measure:
Previous Week Electricity =
IF (
ISINSCOPE ( 'Calendar'[Week Num] ),
CALCULATE (
SUM ( Electrical[Value] ),
'Calendar'[Week Num]
= MAX ( 'Calendar'[Week Num] ) - 1
),
CALCULATE (
SUM ( Electrical[Value] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = MAX ( 'Calendar'[Date] ) - 7 )
)
)
Get the correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Kim_Sky,
As you see in below DAX mentioned by you, you are trying to filter maxdate - 7 means only one day.
Previous Week Electricity = calculate(sum(Electrical[Value]),FILTER(all('Calendar'),'Calendar'[Date]=MAX('Calendar'[Date])-7))
Appreciate a Kudos!
If this helps and resolves the issue, please mark it as a Solution!
Regards,
N V Durga Prasad
Hi @nvprasad
I have try to using calendar [week num] for calculate one week before, but in the graph for daily the value won't be changed.
Are there any recommended dax that I can use?
Thanks for your help
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 |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |