cancel
Showing results for
Did you mean:

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

Regular Visitor

Comparing two columns for Card visual

Hello, I am new to DAX expressions so hoping someone can help.

I have two columns from a SharePoint List source. I want to compare Column 1 to Column 2 if it is equal to, greater than or less than and then display the number of rows in a Card visual (so essentially I will have 3 Card visuals with a number in each - one for equal to, one for greater than and one for less than).

I've tried new measures but everything I put in so far is invalid.

1 ACCEPTED SOLUTION
Super User

@v-rouge Maybe:

``````Measure 1 = COUNTROWS(FILTER('Table',[Column1]=[Column2]))

Measure 2 = COUNTROWS(FILTER('Table',[Column1]<[Column2]))

Measure 3 = COUNTROWS(FILTER('Table',[Column1]>[Column2]))``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
3 REPLIES 3
Super User

@v-rouge

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?

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

Click on the Thumbs-Up icon if you like this reply 🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Super User

@v-rouge Maybe:

``````Measure 1 = COUNTROWS(FILTER('Table',[Column1]=[Column2]))

Measure 2 = COUNTROWS(FILTER('Table',[Column1]<[Column2]))

Measure 3 = COUNTROWS(FILTER('Table',[Column1]>[Column2]))``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Regular Visitor

Genius - that worked. Thanks so much @Greg_Deckler! I'll mark it as solved now.

Announcements

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors