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 August 31st. Request your voucher.

Reply
S_Berg
Frequent Visitor

Calculation with multiple filters

I need to calculate:

When Payment_Type = 1

AND Service_Type = 1

Then multiple Payment_Type by Year_Rate

 

When I try:

Payment = IF(
    AND(
        COUNT(FILES_PAYMENT[Service_Type])= 01,
        COUNT(FILES_PAYMENT[Payment_Type])= 1),
        CALCULATE(
            SUM(RATES[Year_Rate])*COUNT(FILES_PAYMENT[Payment_Type])))
 
It does not filter out the other Payment_Type and is not calculating the total payment for Service_Type of 01.
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @S_Berg 

 

You can try the following methods.

Payment = CALCULATE ( SUM ( RATES[Year_Rate] ))
            * CALCULATE ( COUNT ( FILES_PAYMENT[Payment_Type] ),
                FILTER ( ALL ( FILES_PAYMENT ), [Payment_Type] = 1 && [Service_Type] = 1 )
            )

If that doesn't resolve your issue, provide sample data and expected output.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @S_Berg 

 

You can try the following methods.

Payment = CALCULATE ( SUM ( RATES[Year_Rate] ))
            * CALCULATE ( COUNT ( FILES_PAYMENT[Payment_Type] ),
                FILTER ( ALL ( FILES_PAYMENT ), [Payment_Type] = 1 && [Service_Type] = 1 )
            )

If that doesn't resolve your issue, provide sample data and expected output.

 

Best Regards,

Community Support Team _Charlotte

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

FreemanZ
Super User
Super User

hi @S_Berg 

Could you help paste some sample data to help those who might be able to help you?

tberr86
Frequent Visitor

Try:
Payment= IF(AND(FILES_PAYMENT[Service_Type]= 1,FILES_PAYMENT[Payment_Type]= 1),[Year_Rate]*[Payment_Type])

You may run into errors depending on data type as this function assumes a number data type not a string.

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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