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

Filtering results from SUMMARIZECOLUMNS

Can anyone help? I have the following code:

 

Data = FILTER(SUMMARIZECOLUMNS(
Invoices[Account],
Invoices[ClientID],
Invoices[CostCentre],
Invoices[Date],
Invoices[DebtorCode],
Invoices[Description],
Invoices[Gestation],
"Fees", SUM(Invoices[Fee])
), Invoices[Description] IN {"Jackets","Tops"} )
 
My problem is that I can filter the data coming from Invoices but I need to filter on the results of the expression where the result of the Fees expression is not equal to zero.
In other words I want to ignore returns so if a purchase is 50 then a return goes through giving another row with -50 the result of summarizecolumns will be zero.
 
Thanks in advance 🙂
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try the following code:

 

Data =
FILTER (
    SUMMARIZECOLUMNS (
        Invoices[Account],
        Invoices[ClientID],
        Invoices[CostCentre],
        Invoices[Date],
        Invoices[DebtorCode],
        Invoices[Description],
        Invoices[Gestation],
        "Fees", SUM ( Invoices[Fee] )
    ),
    Invoices[Description] IN { "Jackets", "Tops" }
        && [Fees] <> 0
)

Be aware that the [Fees] is the column you are using on the SUMMARIZECOLUMNS that you created, when making tables you can reference column from that virtual table to filter out values.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@Anonymous Please post the sample data and expected output, which will be helpful to suggest you an accurate solution.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Output as an example would be

 

Account ClientID CostCentre Date          DebtorCode Description Gestation Fees

123         6            23              20180303  26                 Trousers      6              36 

126         8            24              20180307  26                 Jacket          7              0

 

I could filter out the second record once I have generated the table but I don't want the second record as it was return as it is zero and the only way I know it is zero from records is because when I used SUM in SUMMARIZECOLUMNS the fee for the sale and the fee for the return cancelled each other out.

 

For modelling I need the Fees = 0 to be filtered out during the creation of the table not by a measure afterwarrds.

 

Thanks in advance.

Hi @Anonymous ,

 

Try the following code:

 

Data =
FILTER (
    SUMMARIZECOLUMNS (
        Invoices[Account],
        Invoices[ClientID],
        Invoices[CostCentre],
        Invoices[Date],
        Invoices[DebtorCode],
        Invoices[Description],
        Invoices[Gestation],
        "Fees", SUM ( Invoices[Fee] )
    ),
    Invoices[Description] IN { "Jackets", "Tops" }
        && [Fees] <> 0
)

Be aware that the [Fees] is the column you are using on the SUMMARIZECOLUMNS that you created, when making tables you can reference column from that virtual table to filter out values.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thank you that worked perfectly. Thank you 🙂

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.