Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there ;
i need your kind support for below issue pls :
i have table as below , the yellow marked last colum that i want to create in my table.I need dax formula for column , not measure.
So pls let me explain what is this table and in which rules i need yellow column.
in this table there are materials that indexed as group for each them , there are request quantities and request dates , delivery quantities and delivery dates ,
" open quantity" column shows : request quantity -delivery quantity
"statu" column shows that if all the materials delivered or not , if all material delivered closed , if not open.
i would like to find if there is violation while delivering quantities.So rules like that :
to make your calculation easier i am sharig with you excels ource as below :
https://drive.google.com/file/d/1252yy235azu94tCWCUDAbjI3f1FPEqvy/view?usp=sharing
i hope it is clear thanks in advance for your kind help
Solved! Go to Solution.
Hey @erhan_79 ,
I assume this DAX statement allows to create a calculated column that returns what you are looking for:
violation =
var __Material = 'Table'[Material]
var __Index = 'Table'[Index]
var __Status = 'Table'[Status]
var __DeliveryDate = 'Table'[Delivery Date]
var doSucceedingDeliveriesExist =
IF( __Status = "Open"
, IF(
CALCULATE(
MAX( 'Table'[Delivery Quantity] )
, FILTER(
ALL( 'Table')
, 'Table'[Material] = __Material && 'Table'[Index] > __Index
)
) > 0
, "Violation"
, BLANK()
)
)
var doOpenPreceedingDeliveriesExist =
IF( __Status = "Closed"
, IF(
CALCULATE(
MIN( 'Table'[Delivery Date] )
, FILTER(
ALL( 'Table')
, 'Table'[Material] = __Material && 'Table'[Index] > __Index
)
) <= __DeliveryDate
, "Violation"
, BLANK()
)
)
return
IF( doSucceedingDeliveriesExist = "Violation" || doOpenPreceedingDeliveriesExist = "Violation"
, "Violation"
, BLANK()
)
Here is a screenshot of the result, be aware that I call the column violation:
Hopefully, this provides what you are looking for.
Regards,
Tom
Hey @erhan_79 ,
I assume this DAX statement allows to create a calculated column that returns what you are looking for:
violation =
var __Material = 'Table'[Material]
var __Index = 'Table'[Index]
var __Status = 'Table'[Status]
var __DeliveryDate = 'Table'[Delivery Date]
var doSucceedingDeliveriesExist =
IF( __Status = "Open"
, IF(
CALCULATE(
MAX( 'Table'[Delivery Quantity] )
, FILTER(
ALL( 'Table')
, 'Table'[Material] = __Material && 'Table'[Index] > __Index
)
) > 0
, "Violation"
, BLANK()
)
)
var doOpenPreceedingDeliveriesExist =
IF( __Status = "Closed"
, IF(
CALCULATE(
MIN( 'Table'[Delivery Date] )
, FILTER(
ALL( 'Table')
, 'Table'[Material] = __Material && 'Table'[Index] > __Index
)
) <= __DeliveryDate
, "Violation"
, BLANK()
)
)
return
IF( doSucceedingDeliveriesExist = "Violation" || doOpenPreceedingDeliveriesExist = "Violation"
, "Violation"
, BLANK()
)
Here is a screenshot of the result, be aware that I call the column violation:
Hopefully, this provides what you are looking for.
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |