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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

COUNT Difference between two measures

I have two measures: AUCTION and PURCHASE and I need to count how many times AUCTION is larger than PURCHASE.

restevez11_0-1664495734502.png

 

Both AUCTION and PURCHASE are coming from a measure calculated like this:

restevez11_1-1664495794786.pngrestevez11_2-1664495812752.png

Thanks!

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=countrows(filter(values(calendar[Dia]),[Auction]>[Purchase]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=countrows(filter(values(calendar[Dia]),[Auction]>[Purchase]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
VahidDM
Super User
Super User

HI @Anonymous 

 

Try this:

Measure =
VAR _A =
    ADDCOLUMNS (
        SUMMARIZE ( Precios, Precios[Dia], "Auc", [AUCTION], "Pur", [PURCHASE] ),
        "AA", IF ( [Auc] > [Pur], 1, 0 )
    )
RETURN
    SUMX ( _A, [AA] )

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 



Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors