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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Row comparison and calculation

Hi community,

 

I have 2 tables : the first one contains data measured (named "Valeur" below) and another one contains the max limit (named "Maxi" below).

What I need is :

1) Do a comparison between "Valeur" and "Maxi" for each rows in order to identify if my measure reachs a limit

2) I want to count how many measure reach its limits 

 

Actually, my DAX formula with Calculate and Count function doesn't differenciate the different measure (named "Designation" below).

It returns 2 cause Etain and Cuivre are higher than 0.5 instead of returning 1 as the good result.

In fact, Cuivre is OK because Valeur 1.00 is lower than Maxi 1.5

Etain is not OK because Valeur 1.00 is higher than Maxi 0.5

Plomb is OK because Valeur 0.00 is lower than Maxi 2.0

 PBI - Data comparison.png

 

Does anyone have an idea how to fix it ?

 

Thanks a lot

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@Anonymous  I hope you are looking for something like this...

 

Please try this as a New Measure

 

Test290 = CALCULATE(DISTINCTCOUNT(Test290Measure[Designation]),FILTER(Test290Measure,Test290Measure[Value]>Test290Measure[MaxValue]))




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Hello @PattemManohar , thanks for your answer.

It was my first idea but unfortunately it didn't work.

 

First of all, we must add an agregation for the comparison to be validated by editor

> Min(Test290Measure[Maxvalue]

Then, by agregation MIN, PBI only considers the value 0.5 and compare it with the 3 others value (1.0 , 2.0 and 0.0) instead of comparing 3 times (for the 3 measures) Maxi and Valeur (1.0>1.5? 2.0>0.5? 0.0>2.0?)

 

So PBI return 2 (cause it see 1.0 and 2.0 are > 0.5) instead of resulting 1 (only 2.0>0.5).

 

Hope you understand my issue...

@Anonymous  Just to confirm, I've considered your sample data as table and performed the above measure logic which returned me 1 (As expected). Is the above screenshot of your sample data contains measures in that ? 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Non, no measures added to the table.

 

I think I understand the problem.

As I explain on my first post, the column "valeur" come from one data table "Donnés" and the column "maxi" come from another data table called "Objectifs".

These 2 tables have common filter "Moteur" and "Designation" (Related) which could allow direct comparison between "Valeur" and "Maxi".

But as I can see, it's not really what happen, I don't know why... Maybe too complex ?PBI relation.png

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors