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
selected_
Helper IV
Helper IV

How to calculate with filter

If I have a column with different values like below, how do I calcuate it?

 

CategoryValues
Income34232
Expanses66554
Cost of sales4342
Taxes6655

 

I wanna for example calucalte cost of sales divided with taxes in the category. 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @selected_ 

You can try something like below.

 

Picture1.png

 

Values Total =
SUM('Table'[Values])
 
Result 1 =
DIVIDE (
CALCULATE ( [Values Total], 'Table'[Category] = "Cost of sales" ),
CALCULATE ( [Values Total], 'Table'[Category] = "Taxes" )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @selected_ 

Not clear about your expected result, so I assume that you want to calculate items in the category divided with taxes.

If so, you can take steps bellow for reference.

  1. Create the measure:
M_divide =
DIVIDE (
    SELECTEDVALUE ( 'Table'[Values] ),
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Values] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Category] = "Taxes" )
    )
)

Result:

v-xiaotang_0-1620294217119.png

If you want to change the number of decimal places:

v-xiaotang_1-1620294217124.png

Hope this helps.

 

Best Regards,

Community Support Team _ Tang

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

Jihwan_Kim
Super User
Super User

Hi, @selected_ 

You can try something like below.

 

Picture1.png

 

Values Total =
SUM('Table'[Values])
 
Result 1 =
DIVIDE (
CALCULATE ( [Values Total], 'Table'[Category] = "Cost of sales" ),
CALCULATE ( [Values Total], 'Table'[Category] = "Taxes" )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.