Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi evryone,
I need help with the calculation:
I heve this measure:
orders in last 30 days | change | |
29/05/2023 | 10 | 3 |
28/05/2023 | 7 | -1 |
27/05/2023 | 8 | 3 |
26/05/2023 | 5 | -4 |
25/05/2023 | 9 | 4 |
24/05/2023 | 5 | -1 |
23/05/2023 | 6 | 6 |
avg | 1.4 |
Solved! Go to Solution.
@sapirmarko , Try like
Calculate(AVERAGEX(Values('Date'[Date]), [This Day] - [diff]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY) )
Hi, @sapirmarko
You can try the following methods.
Measure:
Change =
Var _Previousdate=MAXX(FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])),[Date])
Var _Previousorder=CALCULATE(SUM('Table'[orders in last 30 days]),FILTER(ALL('Table'),[Date]=_Previousdate))
Var _Currentorder=SUM('Table'[orders in last 30 days])
Return
_Currentorder-_Previousorder
Result = IF(HASONEVALUE('Table'[Date]),[Change],AVERAGEX('Table',[Change]))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks! it's working great!
Hi, @sapirmarko
You can try the following methods.
Measure:
Change =
Var _Previousdate=MAXX(FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])),[Date])
Var _Previousorder=CALCULATE(SUM('Table'[orders in last 30 days]),FILTER(ALL('Table'),[Date]=_Previousdate))
Var _Currentorder=SUM('Table'[orders in last 30 days])
Return
_Currentorder-_Previousorder
Result = IF(HASONEVALUE('Table'[Date]),[Change],AVERAGEX('Table',[Change]))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@sapirmarko , Try like
Calculate(AVERAGEX(Values('Date'[Date]), [This Day] - [diff]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY) )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |