Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Plfrcs
Frequent Visitor

Return a value from another table with row count parity conditions

Hi

 

I'm trying to return value from another table by checking uneven parity of counting row with calculations of conditions.

 

Currently i have to use multiple colum to check for each name wich ID is corresponding.

 

Capture d'écran 2023-12-01 230610.png

 

Is there a way to optimize this calculation which is too heavy to be publish with a large dataset ?

 

Here is the actual formula for each column :

VAR ID =  Table1[ID]

RETURN
IF(
    ISEVEN(
        SUMX(
            ADDCOLUMNS(
                    GENERATE(FILTER(Table1, Table1[ID] = ID ),
                     Table2 ),"@", INT ( (Table2[Name]="X")  && (Table1[Col1]-Table2[A]=Table1[Col2]))),
            [@] 
            )
        ),
    "No","Yes")

 

And the formula for deduce the name

 

Name = IF(Table1[Check X]="Yes","X",IF(Table1[Check Y]="Yes","Y",IF(Table1[Check Z]="Yes","Z","/")))

 

Thx

2 ACCEPTED SOLUTIONS
Ahmedx
Super User
Super User

Plfrcs
Frequent Visitor

Thank's for Ahmedx for you solution. In the meantime I've found a solution that seems to perform better when refreshing. 

 

 

Name = 
VAR __ID =  'Desired Tablet'[ID]
VAR __datas = ADDCOLUMNS(GENERATE ( FILTER ( Table1, 'Table1'[ID] = __ID ), FILTER(Table2, Table1[Col1]-Table2[A]=Table1[Соl2])),"@",1)
VAR __datassummerize = GROUPBY(__datas,Table1[ID],[Name],"@",SUMX(CURRENTGROUP(),[@]))
RETURN
MAXX(
   FILTER(__datassummerize, 
      ISODD([@])
   ),
   [Name]
)

 

 

View solution in original post

2 REPLIES 2
Plfrcs
Frequent Visitor

Thank's for Ahmedx for you solution. In the meantime I've found a solution that seems to perform better when refreshing. 

 

 

Name = 
VAR __ID =  'Desired Tablet'[ID]
VAR __datas = ADDCOLUMNS(GENERATE ( FILTER ( Table1, 'Table1'[ID] = __ID ), FILTER(Table2, Table1[Col1]-Table2[A]=Table1[Соl2])),"@",1)
VAR __datassummerize = GROUPBY(__datas,Table1[ID],[Name],"@",SUMX(CURRENTGROUP(),[@]))
RETURN
MAXX(
   FILTER(__datassummerize, 
      ISODD([@])
   ),
   [Name]
)

 

 

Ahmedx
Super User
Super User

pls try this

Screenshot_2.png

Screenshot_1.png

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.