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
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
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.

Top Solution Authors