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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Employee
Employee

Hi @Anonymous,

 

 

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

6 REPLIES 6
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

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.
Anonymous
Not applicable

Done! 

Sorry for being late, I was away.

 

Thank you very much!

v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

 

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.
Anonymous
Not applicable

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 @Anonymous,

 

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.

Hi All,

I am having a similar issue but instead of filtering like this

    FILTER (
        DVENDAS;
        DVENDAS[Agency] IN { "SITE"; "PORTAL" }
            && DVENDAS[Status] = "CHANGE"
            && DVENDAS[SalesType] = "PTA"
    )

 I would like to filter :

    FILTER (
        DVENDAS;
        DVENDAS[Status] = SELECTEDVALUE(Dvendas[STATUS])
        )

 Having a Slicer with all the values for Dvendas[STATUS] for the user to select. This does not work, for some reason it doesn't filter. 
Do you know why Filtering with a SELECTEDVALUE instead of with a specific text "CHANGE" does not work in this situation ? 
Thanks a lot.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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