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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.