Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
It's BITOR but it iterates over any number of rows. Kind of spiffy in that it has 2 different "for" loops.
XBITOR =
VAR __RowCount = COUNTROWS('bitor')
VAR __Length = LEN(MAX('bitor'[day_of_month_bit_position]))
VAR __String = CONCATENATEX('bitor', [day_of_month_bit_position])
VAR __Table =
ADDCOLUMNS(
GENERATESERIES(0, __RowCount * __Length - 1),
"__Bit", MID(__String, [Value]+1, 1) + 0,
"__Mod", MOD([Value], __Length)
)
VAR __Table1 =
ADDCOLUMNS(
GENERATESERIES(0, __Length - 1),
"__BITOR",
VAR __Index = [Value]
VAR __Sum = SUMX(FILTER(__Table, [__Mod] = __Index),[__Bit])
VAR __Result = IF(__Sum = 0, 0, 1)
RETURN
__Result
)
RETURN
CONCATENATEX(__Table1, [__BITOR],,[Value],ASC)
eyJrIjoiZWQzMDhmNjMtNjBiNC00OGFiLWFiODYtNTAwYWVhNmM2OTk2IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9