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
Anonymous
Not applicable

Help with measure and allselectec

Hello,

 

If someone can help me with my report I would be very gratefull!

I'm looking to create a new measure with total of sales in a matrix filtered by context.

 

I start with my matrix filtered  :

 

ID          SALES

A           10

B            20

C           15

D           40

 

what I want is :

 

ID          SALES          TOTAL_OF_SALES

A           10                           85

B           20                           85

C           15                           85

D           40                           85

 

 

Il I create a measure like TOTAL_OF_SALES = CALCULATE(SUM('TABLE1'[SALES]) ; ALLSELECTED('TABLE2'[ID]) )

 

I have this result :

 

ID          SALES          TOTAL_OF_SALES

A           10                           85

X                                          85

B           20                           85

C           15                           85

Z                                          85

D           40                           85

Z4                                        85

Z6                                        85

 

Every ID even those which are out of context appear... someidea to avoid this? 

 

Thanks.

 

Jerome

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello guys,

 

I'm back with a solution...

 

Just need to switch my measure to 

TOTAL_OF_SALES = SUMX(VALUES('TABLE1'[ID2];CALCULATE(SUM('TABLE1'[SALES]) ; ALLSELECTED('TABLE2'[ID]) )

 

And it works perfectly!

 

sorry for the disturbance.

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hello guys,

 

I'm back with a solution...

 

Just need to switch my measure to 

TOTAL_OF_SALES = SUMX(VALUES('TABLE1'[ID2];CALCULATE(SUM('TABLE1'[SALES]) ; ALLSELECTED('TABLE2'[ID]) )

 

And it works perfectly!

 

sorry for the disturbance.

 

 

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.