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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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