cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexandrecr
Helper I
Helper I

Summarize with multiple filtering

Hi, 

 

I'm beginner in DAX and I have a problem: a table called 'DVENDAS' with this columns: [Ticket], [Agency], [ServiceDate], [Service], [Source], [Destination], [Status] and more;

 

And I'm trying to create a new table with this idea: I have to SUMMARIZE this columns above, and FILTER by [Agency] AND [Status], but filtering Agency in two terms: "SITE" OR "PORTAL"; filtering Status only for "CHANGE".

 

Table = SUMMARIZE (
    FILTER ( 'DVENDAS'; RELATED ( DVENDAS[Agency] ) = "SITE" || DVENDAS[Agency] = "PORTAL" && DVENDAS[Status] = "CHANGE" );
    DVENDAS;
    DVENDAS[Ticket];
    DVENDAS[Agency];
    DVENDAS[ServiceDate];
    DVENDAS[Service];
    DVENDAS[Source];
    DVENDAS[[Destination];
    DVENDAS[Status]

    
)
    

But I got error.

Please help 🙂

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft
Microsoft

Hi @alexandrecr,

 

 

Try this formula, please.

Table =
CALCULATETABLE (
    SUMMARIZE (
        DVENDAS;
        DVENDAS[Ticket];
        DVENDAS[Agency];
        DVENDAS[ServiceDate];
        DVENDAS[Service];
        DVENDAS[Source];
        DVENDAS[[Destination];
        DVENDAS[Status]
    );
    FILTER (
        DVENDAS;
        DVENDAS[Agency] IN { "SITE"; "PORTAL" }
            && DVENDAS[Status] = "CHANGE"
    )
)

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

5 REPLIES 5
v-jiascu-msft
Microsoft
Microsoft

Hi @alexandrecr,

 

Could you please mark the proper answers as solutions?

 

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.

Done! 

Sorry for being late, I was away.

 

Thank you very much!

v-jiascu-msft
Microsoft
Microsoft

Hi @alexandrecr,

 

 

Try this formula, please.

Table =
CALCULATETABLE (
    SUMMARIZE (
        DVENDAS;
        DVENDAS[Ticket];
        DVENDAS[Agency];
        DVENDAS[ServiceDate];
        DVENDAS[Service];
        DVENDAS[Source];
        DVENDAS[[Destination];
        DVENDAS[Status]
    );
    FILTER (
        DVENDAS;
        DVENDAS[Agency] IN { "SITE"; "PORTAL" }
            && DVENDAS[Status] = "CHANGE"
    )
)

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

Thanks a lot, @v-jiascu-msft!

 

And what if I want to filter by [Agency] equals "SITE" and "PORTAL" AND [Status] equals "CHANGE" AND [SalesType] equals "PTA"?

Hi @alexandrecr,

 

You can add more conditions to the filter part. Which table is [SalesType] in?

Table =
CALCULATETABLE (
    SUMMARIZE (
        DVENDAS;
        DVENDAS[Ticket];
        DVENDAS[Agency];
        DVENDAS[ServiceDate];
        DVENDAS[Service];
        DVENDAS[Source];
        DVENDAS[Destination];
        DVENDAS[Status]
    );
    FILTER (
        DVENDAS;
        DVENDAS[Agency] IN { "SITE"; "PORTAL" }
            && DVENDAS[Status] = "CHANGE"
            && DVENDAS[SalesType] = "PTA"
    )
)

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.

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors