Forum Discussion
Identifying pass/fail based on binnings
- 1 year ago
Hi - thanks for all your help.
I found the solution by creating a sequential mapping in excel - then I added up each of the sequential as a sum eg. Bins 1 --> 1, Bins 2 -->2, Bins 3--> 3 then to sum it and make it as ID eg. 1+0 = 1, 1+2= 3, 1+2+3 =6 and so on. This will identify if there's any missing gaps throughout the bins's sequence.
Thanks Poojara_D12 - rajendraongole1 has provided similar refined DAX unfortunately it doesn't work as giving this error : "The arguments in GenerateSeries function cannot be blank"
Can you please try the below
Missing_Bins =
VAR CaseID = SELECTEDVALUE(Summary_HistoryCases[casenumber])
-- Get the unique bin numbers for this Case ID
VAR ExistingBins =
CALCULATETABLE(
VALUES(Summary_HistoryCases[Bins]),
Summary_HistoryCases[casenumber] = CaseID
)
-- Ensure there are existing bins before calculating min/max
VAR MinBin = MINX(ExistingBins, Summary_HistoryCases[Bins])
VAR MaxBin = MAXX(ExistingBins, Summary_HistoryCases[Bins])
-- Handle blank MinBin/MaxBin by setting defaults
VAR SafeMinBin = IF(ISBLANK(MinBin), 0, MinBin) -- Default to 0 if blank
VAR SafeMaxBin = IF(ISBLANK(MaxBin), 0, MaxBin) -- Default to 0 if blank
-- Generate the expected sequence only if valid bins exist
VAR ExpectedBins =
IF(SafeMinBin <> 0 && SafeMaxBin <> 0,
GENERATESERIES(SafeMinBin, SafeMaxBin, 1),
BLANK()
)
-- Find missing bins only if ExpectedBins is not blank
VAR MissingBins =
IF(
NOT(ISBLANK(ExpectedBins)),
EXCEPT(
ExpectedBins,
ExistingBins
),
BLANK()
)
-- Return "Fail" if there are missing bins, "Pass" if all bins exist
RETURN
IF(SafeMinBin = 0 || SafeMaxBin = 0, "No Data",
IF(NOT(ISBLANK(MissingBins)) && COUNTROWS(MissingBins) > 0, "Fail", "Pass")
)
still issue exist,please let me know.
- jhauw741 year ago
Helper I