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.
hey all, whats up?
so my boss told me he wants a line chart that presents the % difference between two running totals.. so far so good - i have created the measures for the running total which:
Solved! Go to Solution.
Hi @Anonymous ,
We can use the following measure to meet your requirement.
Last 4 weeks =
var last_4 = MAX('Table'[Date])-4*7
var current_ = MAX('Table'[Date])
return
CALCULATE(SUM('Table'[values]),FILTER(ALLSELECTED('Table'),'Table'[Date]>last_4 && 'Table'[Date] <= current_))
The Last 4 weeks values doesn’t change if you select a slicer date, you can use the following measure. Replace ALLSELECTED with ALL.
Last 4 weeks =
var last_4 = MAX('Table'[Date])-4*7
var current_ = MAX('Table'[Date])
return
CALCULATE(SUM('Table'[values]),FILTER(ALL('Table'),'Table'[Date]>last_4 && 'Table'[Date] <= current_))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can use the following measure to meet your requirement.
Last 4 weeks =
var last_4 = MAX('Table'[Date])-4*7
var current_ = MAX('Table'[Date])
return
CALCULATE(SUM('Table'[values]),FILTER(ALLSELECTED('Table'),'Table'[Date]>last_4 && 'Table'[Date] <= current_))
The Last 4 weeks values doesn’t change if you select a slicer date, you can use the following measure. Replace ALLSELECTED with ALL.
Last 4 weeks =
var last_4 = MAX('Table'[Date])-4*7
var current_ = MAX('Table'[Date])
return
CALCULATE(SUM('Table'[values]),FILTER(ALL('Table'),'Table'[Date]>last_4 && 'Table'[Date] <= current_))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hey @v-zhenbw-msft , thanks alot for your message, its working! the 2nd measure is exactly what i needed.
THANKS!!
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |