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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Sumup Column based on Filter as Calculated Column

Hi Guys, Can someone help to get the formula in a calculated Column. (I derived it in Measure, but i need the same calculation in Calculated Column).

Measure Formula: Current Month Total = CALCULATE( SUM('Table1'[Month 1]), 'Table1'[Class] IN { "A" } ) 

how to get this done with Calculated Column?
Note: I need this Calculated Column since i was unable to add the Measure as "Page filter"
Thanks.

 

ClassMonth 1Month 2Month 3
A102022
B1213123
A131412
1 ACCEPTED SOLUTION

hi  @Anonymous 

4.JPG

Do you want show this expected output in power bi calculated table?

If so, you need to create a new table like below:

New table = SUMMARIZE(Table1,Table1[Subject],"Month 1",CALCULATE(SUM(Table1[Month1]),FILTER(Table1,Table1[Class]="A")))

Result:

5.JPG

 

here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

hi  @Anonymous 

Just adjust the formula as below:

CALCULATE( SUM('Table1'[Month 1]), FILTER(ALL(Table1),'Table1'[Class] IN { "A" } ))
 
Regards,
Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-lili6-msft  this formula which you provided sums all i guess.., i am not getting the value only for that particular selection. 😞

amitchandak
Super User
Super User

Create a column like

Current Month = if('Table1'[Class] IN { "A" },'Table1'[Month 1],blank() )

and choose Agg sum when use.

But I not clear with data model you posted.

In case you are looking for slicer to give you which measure then refer

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak this doesnt gives the correct value.., All i need is to filter "A" in Class and get the Month1 data for all A in calculated Column. Below is my exact version of data which i loaded in Power BI. 

SubjectClassMonth1
MathsA10
MathsB13
MathsA11
ComputerA24

 

The value which i expect is in Power BI Table is:

 

SubjectMonth 1
Maths21
Computer24

 

it just filter only "A" and provide the value against it.

Measure Formula which works: Current Month Total = CALCULATE( SUM('Table1'[Month 1]), 'Table1'[Class] IN { "A" } ) 

and same formula i need in Calcluated Column...

hi  @Anonymous 

4.JPG

Do you want show this expected output in power bi calculated table?

If so, you need to create a new table like below:

New table = SUMMARIZE(Table1,Table1[Subject],"Month 1",CALCULATE(SUM(Table1[Month1]),FILTER(Table1,Table1[Class]="A")))

Result:

5.JPG

 

here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you @v-lili6-msft it works 🙂 thanks a lot.., 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.