Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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