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
DustinD
Helper I
Helper I

need help on how to take all rows for an item into account.

i have made a mock up of what my table looks like. so my goal is to take remsales minus onhand for a item and return y or n if we can cover all orders. so for example below 432-10 is in the table 2 times. when test runs which is what im using to show what im looking for. i want it to take all orders for a part not just a row level. the first item in the chart can be coverred but at the bottom we see the item again and we do not have enough to cover both orders so it should return n for that item number. 

 

 

DustinD_1-1698671570172.png

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @DustinD ,

 

try to add a calculated column like:

Test2 = 
VAR _t = FILTER(data, data[Item]=EARLIER(data[Item]))
VAR _r = SUMX( _t, data[Resales])
VAR _o = MAXX( _t, data[On-Hand])
RETURN
IF(_o>=_r, "y", "n")

 

it worked like:

FreemanZ_0-1698673486452.png

 

View solution in original post

4 REPLIES 4
DustinD
Helper I
Helper I

this worked exactly how i wanted. thanks 

FreemanZ
Super User
Super User

hi @DustinD ,

 

try to add a calculated column like:

Test2 = 
VAR _t = FILTER(data, data[Item]=EARLIER(data[Item]))
VAR _r = SUMX( _t, data[Resales])
VAR _o = MAXX( _t, data[On-Hand])
RETURN
IF(_o>=_r, "y", "n")

 

it worked like:

FreemanZ_0-1698673486452.png

 

will evrey row having its own order number effect using this dax? @FreemanZ 

no, it won't. just try and let us know. 

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!

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.