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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
davehus
Memorable Member
Memorable Member

Summarize Table and Filter by Date

Hi, 

 

I have a summarized table but I want to filter to the current year. How to I amend the code below to make that happen? 

Order Profile = 
SUMMARIZE (
    'Sales Table',
    'Sales Table'[Order_Num_Key],
    Customer[Sector],
    "Total Value", SUM ( 'Sales Table'[Net Invoice Value] ),
    "Order Count", DISTINCTCOUNT('Sales Table'[Order_Num_Key])
)

 Thanks 🙂 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @davehus,

 

Try something like below please. "DimDate" is a date table.

Order Profile =
CALCULATETABLE (
    SUMMARIZE (
        'Sales Table',
        'Sales Table'[Order_Num_Key],
        Customer[Sector],
        "Total Value", SUM ( 'Sales Table'[Net Invoice Value] ),
        "Order Count", DISTINCTCOUNT ( 'Sales Table'[Order_Num_Key] )
    ),
    YEAR ( DimDate[Datekey] ) = YEAR ( TODAY () )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi All,

What if I want to filter the summarized table using one of the aggregated columns?

@Anonymous can you provide an example of what you saying?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @davehus,

 

Try something like below please. "DimDate" is a date table.

Order Profile =
CALCULATETABLE (
    SUMMARIZE (
        'Sales Table',
        'Sales Table'[Order_Num_Key],
        Customer[Sector],
        "Total Value", SUM ( 'Sales Table'[Net Invoice Value] ),
        "Order Count", DISTINCTCOUNT ( 'Sales Table'[Order_Num_Key] )
    ),
    YEAR ( DimDate[Datekey] ) = YEAR ( TODAY () )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Pleae can you explain the solution ? why we  can't use dimate filter within the SUMMARIZE funciton.

Thank you @v-jiascu-msft & @vanessafvg

vanessafvg
Super User
Super User

@davehus  don't know if this helps

 

https://blogs.msdn.microsoft.com/karang/2013/02/15/dax-using-filter-and-summarize-in-same-query/





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.