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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Count if cell greater than another in same row

Seeking Dax Formula to:

1.  Count number of stock lines where "Stock on Hand" is Greater than "Maximum Stock". eg. using below capture four lines indicate the "On Hand" is greater than "Maximum Stock".  Therefore result should be 4 when I create a visual

 

2. Count Qty where "Stock on Hand" is Greater than "Maximum Stock" value from the above. eg. Item Code 4008151 has Qty 12 "On Hand" therefore Count over "Maximum stock" result should be "7"

 

3.  Value of Qty where "Stock on Hand" is Greater than the "Maximum Stock" using "Last cost" for the Item Code. 

 

2023-01-17_16-58-56.jpg

1 REPLY 1
m-kats
Frequent Visitor

Hello @Anonymous 

 

Maybe you should try the countx and sumx functions like:

 

1. No of Stock Lines = COUNTX(FILTER('Table', 'Table'[Stock on Hand]>'Table'[Maximum Stock]), 'Table'[Maximum Stock])

2. I cannot find the difference between the 1st and 2nd bullet

3.  Sum of Cost = SUMX(FILTER('Table', 'Table'[Stock on Hand]>'Table'[Maximum Stock]), 'Table'[Last cost])

 

Hope I helped!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.