Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Sumarise new table based on date range

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

TypeDateNo
A12/12/202115
A17/12/20212
A21/12/20215
C8/12/20213
D4/01/20222
Result  
TypeDateTotal
A17/12/20217
D4/01/20222

 

 

 

3 REPLIES 3
Anonymous
Not applicable

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:

 

VahidDM_1-1642743373984.png

 

 

 

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/

 

 

VahidDM
Super User
Super User

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:

VahidDM_0-1642723484044.png

 

 

 

 

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/

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.