The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Im trying to sumarise data with dax query to create a new table based on date ranges. This an example and what it should look like for example range between 17/12/2021 to 10/01/22
Date
Type | Date | No |
A | 12/12/2021 | 15 |
A | 17/12/2021 | 2 |
A | 21/12/2021 | 5 |
C | 8/12/2021 | 3 |
D | 4/01/2022 | 2 |
Result | ||
Type | Date | Total |
A | 17/12/2021 | 7 |
D | 4/01/2022 | 2 |
Thanks for getting back that is what I got, but I want it to totaled it for A (2+5)
@Anonymous
Try this code:
New Table =
VAR _Start =
DATE ( 2021, 12, 17 )
VAR _End =
DATE ( 2022, 01, 10 )
RETURN
SUMMARIZE (
FILTER ( 'Table', 'Table'[Date] >= _Start && 'Table'[Date] <= _End ),
'Table'[Type],
"Date", MIN ( 'Table'[Date] ),
"Total", SUM ( 'Table'[No] )
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @Anonymous
How did you calculate 7 for line 17/12/2021?
BTW, if you want to filter the table with a date range, use this code to add new table with dax:
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |