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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
I1qq6uyz
New Member

Sum If - Same Column

Hi all,

I am having a problem to solved this problem:

I want to create a sumif that references a cell to the whole column.
Example below:

I have a column with cars and I would like to create a column that sums all the lines that the number is more than the referent column.

CarNew Column
113
211
38
40
40

 

In excel it would be something like =SUMIF(B8:B12,">"&B8), but in DAX I don't know if it's possible to solve.
In my view would below line, but it is not working

CALCULATE(SUM(Data[Car]),Data[Car]>Data[Car])

Regards,

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @I1qq6uyz 

According to your description, you want to create a column that shows all the lines that the number is more than the referent column, right?

In the Power BI, you can just use the table chart to display as a new column because this column is filtered by the selection of a slicer. I think you can create a new table and a slicer to filter a table chart to achieve your requirement, you can follow my steps:

Create a calculated table:

Car = SUMMARIZE('Table1',Table1[Car])

Create a measure like this:

Flag =

var _selectedcolumn=CALCULATE(MAX('Table1'[New Column]),FILTER(ALL('Table1'),[Car]=SELECTEDVALUE('Car'[Car])))

return

IF(MAX('Table1'[New Column])>_selectedcolumn,1,0)

 

Then you can create a car slicer to place the column in the new table and a table chart to set the filter and summarize type like this:

vrobertqmsft_0-1635761396888.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @I1qq6uyz 

According to your description, you want to create a column that shows all the lines that the number is more than the referent column, right?

In the Power BI, you can just use the table chart to display as a new column because this column is filtered by the selection of a slicer. I think you can create a new table and a slicer to filter a table chart to achieve your requirement, you can follow my steps:

Create a calculated table:

Car = SUMMARIZE('Table1',Table1[Car])

Create a measure like this:

Flag =

var _selectedcolumn=CALCULATE(MAX('Table1'[New Column]),FILTER(ALL('Table1'),[Car]=SELECTEDVALUE('Car'[Car])))

return

IF(MAX('Table1'[New Column])>_selectedcolumn,1,0)

 

Then you can create a car slicer to place the column in the new table and a table chart to set the filter and summarize type like this:

vrobertqmsft_0-1635761396888.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

goncalogeraldes
Super User
Super User

Hello there @I1qq6uyz ! Not quite sure if I got your question correctly but try this:

CALCULATE(SUM(Data[Car]),Data[Car]>EARLIER(Data[Car]))

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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