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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
bi_team_ru2
Frequent Visitor

changing variant of calculation

HI!

i need calculate 

column CommonSum on table Test_main in power bi desctop in 4 variants:

on setting flag 'Manager'

on setting flag 'Client'

on setting both flag

and without their

 

the table Test_main has relation with tables M<anagers> and C<lients>, contain only one column

i write the next code

SumTotal = if(AND(ISFILTERED('C'[CNaims]);ISFILTERED('M'[MNames])); /*commonfilter */ 
calculate( SUM ('Test_main'[CommonSum] ); 
ALLEXCEPT( 'test_main';'Test_main'[Client];'Test_main'[Manager]); 
'Test_main'[CommonSum] >= EARLIER ( 'Test_main'[CommonSum] ));
/* FilterManager */ 
if(ISFILTERED('Clients'[CNaims]); CALCULATE ( SUM ('Test_main'[CommonSum] ); 
ALLEXCEPT('test_main'; Test_main[Manager] ); 
'Test_main'[CommonSum] >= EARLIER ( 'Test_main'[CommonSum])); 
/* filterClients */ 
if(ISFILTERED('C'[CNaims]);CALCULATE ( SUM ('Test_main'[CommonSum] ); 
ALLexcept('test_main';Test_main[Client]); 'Test_main'[CommonSum] >= EARLIER ( 'Test_main'[CommonSum]));
/* NoFilters */ 
CALCULATE ( SUM ('Test_main'[CommonSum] ); 
ALL/*EXCEPT*/('test_main'/*;'Test_main'[Client];Test_main[Manager]*/ ); 
'Test_main'[CommonSum] >= EARLIER ( 'Test_main'[CommonSum])))))

but without position of flags has on result last variant only

how me to change the code to take other 3 variants?

1 ACCEPTED SOLUTION
bi_team_ru2
Frequent Visitor

good noon!

the probles soluted thouth ALLSELECTED

View solution in original post

1 REPLY 1
bi_team_ru2
Frequent Visitor

good noon!

the probles soluted thouth ALLSELECTED

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors