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

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.

Reply
Mniknejad
Frequent Visitor

Get sum of amount base on third table flag

I have 3 table's first table is 

 

salesdimKEY

SalesAmount

Salesdatekey

Key4

Key5

Key6

Key7

1

1000

 

 

 

 

 

2

-200

 

 

 

 

 

3

2500

 

 

 

 

 

4

2600

 

 

 

 

 

5

-2500

 

 

 

 

 

 

second table is a dim 

 

salesdimKEY

SalesOrderId

Customer

country

1

So001

1

cad

2

So002

2

usa

3

So003

3

IT

4

So004

4

DE

5

So005

5

CAD

 

and third table is a staing table which has related to dim table 

SalesOrderId

Customer

IsActiveFlag

country

So001

1

1

cad

So002

2

1

usa

So003

3

0

IT

So004

4

0

DE

So005

5

1

CAD

 

now I wanted to claculate a measure which shows sales amount for salesorderId with "IsActiveFlag" equal "1" 

Can any body know how cani do this ? what would be the "DAX" code for this 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Mniknejad try below measure

 

Measure = CALCULATE(SUM(Table1[SalesAmount]),Table3[IsActiveFlag]=1)

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi 

 

First connect these 3 tables as the staing table with dim table on sales order ID and sales dim key with sales dim key (1st & 2nd table)

 

Post this, write a measure calculate(sales),activeid =1)

 

If this works, please mark this as solution.

Anonymous
Not applicable

@Mniknejad try below measure

 

Measure = CALCULATE(SUM(Table1[SalesAmount]),Table3[IsActiveFlag]=1)

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.