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
FcoArturo
New Member

Percentage of total using lookup table

Hello, need your help !

I managed to make a percetage of total sales : "% Venta" for each store (code_store).

This uses one table named SalesPOS

FcoArturo_0-1661031816199.png

 

Then I wanted to add a lookup table to get the name of the store (Nombre_Local) , the relationship works perfectly.

FcoArturo_1-1661031979588.png 

FcoArturo_3-1661032135826.png

 

But when i add the StoreName from the Lookup table (Locales), the precentage breaks and I get duplicated values  :

FcoArturo_2-1661032086081.png

 

This is how the Metrics are calculated :

 

 

Overall Sales = CALCULATE( 
                            [Sales Amount],
                            ALL('SalesPOS (noOLD)'[code_store]
                            ))

Sales Amount = SUM('SalesPOS (noOLD)'[total])


% Venta = DIVIDE ( 'SalesPOS (noOLD)'[Sales Amount], 'SalesPOS (noOLD)'[Overall Sales],0)

 

 

Any ideas what AM I doing wrong ?

Thank you!

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @FcoArturo ,

 

Two methods:

1 Change the measure

Overall Sales = 
CALCULATE(
    [Sales Amount],
    ALLSELECTED('Locales')
)

 

2 Change the relationship's crossfilter direction to both.

vchenwuzmsft_0-1661328646718.png

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @FcoArturo ,

 

Two methods:

1 Change the measure

Overall Sales = 
CALCULATE(
    [Sales Amount],
    ALLSELECTED('Locales')
)

 

2 Change the relationship's crossfilter direction to both.

vchenwuzmsft_0-1661328646718.png

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

To your visual, ensure that the Code_Store field is also dragged from the Locales table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
grantsamborn
Solution Sage
Solution Sage

Try this change:

 

Overall Sales = 
CALCULATE(
    [Sales Amount],
    ALL( 'Locales' )
)

 

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.