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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.