Hi,
Can you please help me with ISBLANK funtion.
I am calculating how many days is an order late via this formula:
LATE BY DAYS1 = FORMAT(MAXX(‘COHV Planning’,
TODAY() - ‘COHV Planning’[Basic finish date]), “0”)
I created a virtual table to select the orders which are Late with this formula which works fine.
Late Orders =
SUMX(
CALCULATETABLE(
‘COHV Planning’,
FILTER(‘COHV Planning’,‘COHV Planning’[Order]),
FILTER(‘COHV Planning’, ‘COHV Planning’[Work Centre] <> “00384”),
FILTER(‘COHV Planning’, IF(TODAY() > ‘COHV Planning’[Basic finish date], ‘COHV Planning’[Order], BLANK())),
FILTER(ProdOrderStatus,
ProdOrderStatus[Status] = “REL”)
My question is about ISBLANK, i don’t understand it that well.
Just to simplify, if you want to add it as a column, ISerror function is defined in formula guide of Enterprise DNA to work as follows:
ISBLANK Function (DAX)
Checks whether a value is blank and returns TRUE or FALSE.
Syntax: ISBLANK()
Parameter Definition
value The value or expression you want to test.
Return Value:
A Boolean value of TRUE if the value is blank; otherwise FALSE.
Example:
This formula computes the increase or decrease ratio in sales compared to the previous
year. The example uses the IF function to check the value for the previous year’s sales in
order to avoid a divide by zero error.
Sales to Previous Year Ratio:
=IF(ISBLANK(‘CalculatedMeasures’[PreviousYearTotalSales]),BLANK(),(‘CalculatedMeasur
es’[TotalSales‘CalculatedMeasures’[PreviousYearTotalSales])/’CalculatedMeasures’[Prev
iousYearTotalSales])
Probably another way to look at a solution would be to look at how the table in the screenshot is being populated for the Order list. Conceptually, that order list should only have orders that meet @josuem’s requirement of “I want to not show the orders which are not late …”
I cannot help much with the above suggested approach unless I see the data model that pertains to the challenge at hand, and probably the source of the Order column that is in the table.
Please share at least these if you would like me or some other people on the forum to have a go at finding a solution with my approach.
I think the reason those orders are still showing is because of the Basic Finish Date columns/measure. I will create an if condition to make it dependent on the late days measure.
So If(ISBlank([Late Orders]), Blank(), [Basic finish date]).
I also changed my formula as per below and used calculate as recommended by Piryani, instead of calculatetable. I guess i was overthinking things, as i wanted to iterate the table to do the calculation but Filter iterates also.