Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everyone!
I need some help in case below:
There are two tables A and B:
And I would need to create an additional flag in dax (1/0) - if the LogGroup from table B contains LogKey = 124 then mark whole group as 1 (and therefore whole customer as 1) otherwise mark as 0
The logic for this in SQL would be like:
max( case when B.LogKey = 124 then 1 else 0 end ) OVER (PARTITION BY A.Customer) as Flag
THANK YOU !
Solved! Go to Solution.
Hi @Attrywa ,
Please try:
Create a calculated column in Table A:
Flag =
VAR CurrentGroup = 'Table A'[LogGroupKey]
VAR LogKeyCheck = CALCULATE(
MAXX(
RELATEDTABLE('Table B'),
IF('Table B'[LogKey] = 124, 1, 0)
),
FILTER(
'Table B',
'Table B'[LogGroupKey] = CurrentGroup
)
)
RETURN IF(LogKeyCheck = 1, 1, 0)
The page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
you can create a column
Proud to be a Super User!
you can create a column
Proud to be a Super User!
Hi @Attrywa ,
Please try:
Create a calculated column in Table A:
Flag =
VAR CurrentGroup = 'Table A'[LogGroupKey]
VAR LogKeyCheck = CALCULATE(
MAXX(
RELATEDTABLE('Table B'),
IF('Table B'[LogKey] = 124, 1, 0)
),
FILTER(
'Table B',
'Table B'[LogGroupKey] = CurrentGroup
)
)
RETURN IF(LogKeyCheck = 1, 1, 0)
The page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!