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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to find the values in one column is greater than the values in another column by how many times?

I have two columns and I need to find how many times the values in one column is greater than the values in another column in DAX.

For Example:

Column_A Column_B

8.07 0.70

I want to know how many times is Column A(8.07) is greater than Column_B(0.07)?

1 ACCEPTED SOLUTION

Hey,

please excuse, I misread your question.

Just divide Column_A by Column_B like so:

new columnnam
DIVIDE('tablename'[Column_A], 'tablename'[Column_B], BLANK())

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey,

 

just create calculated column in your table like so:

new columnname = 
IF('tablename'[Column_A] > 'tablename'[Column_B], 1, BLANK())

This creates a numeric column that you can drag to a card visual and it automatically calculates the number of rows where Column_A is greater than Column_B.

 

In addition to that you can use the column to filter the rows.

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hey, Thanks for the reply. However, I am not looking for the number of rows.  I want to know by how many times does the value in column A is greater than column B

Hey,

please excuse, I misread your question.

Just divide Column_A by Column_B like so:

new columnnam
DIVIDE('tablename'[Column_A], 'tablename'[Column_B], BLANK())

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Thank you so much. Worked like a charm 🙂

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.