The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone. How it's going?
I need to create an avarage of the requests made of the last 7 days.
Each line of the table is a request.
The collum "Prazo separacao" is my date.
Please, who can help me?
hi @Lucasr46
it depends on the starting point of last 7 days, if you mean Today/Now, try like:
Hi @Lucasr46 ,
Use this measure:
Measure =
VAR _MAXDATE =
CALCULATE ( MAX ( RequestTable[Date] ), ALL ( RequestTable ) )
RETURN
DIVIDE (
CALCULATE (
SUM ( RequestTable[Request] ),
FILTER (
RequestTable,
RequestTable[Date] <= _MAXDATE
&& RequestTable[Date] >= _MAXDATE - 6
)
),
CALCULATE (
COUNTROWS ( VALUES ( RequestTable[Date] ) ),
FILTER (
RequestTable,
RequestTable[Date] <= _MAXDATE
&& RequestTable[Date] >= _MAXDATE - 6
)
)
)
If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |