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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
JdBernate
Frequent Visitor

Context problem (i guess)

Hi guys

 

im trying to count the products that represent the 80% percent of sales. I need my measure works outside of the report table as a kpi. In the next image you can understand better the situation.

imgpbi.png 

As you can see i got the cumulative sales an the percentage represented by every product. If you check the table, the first 16 products have the 80% of the sales. I made a measure "Number of Top 80% products", that already counts the products!, but when i use the measure as a kpi, outside of the report table (the little rectangle next to the big table) it doesnt work!!. I guess is a context problem but i havent find out the solution. i hope any of you guys could help me:

These are my measures (they are in spanish XD, sorry)

 

Cumulative sales by product

**bleep** totalArti = if(not(ISBLANK([Ventas Netas]));calculate([Ventas Netas];FILTER(all(ListadoArticulos[Descripcion Articulo]);sum(FacturacionDetallada[Ventas Netas])<=[Ventas Netas])))

 

*[ventas netas] means [total sales]

*ListadoArticulos[Descripción Articulo] means Products table[Description]

 

Number of Top 80% products =
CALCULATE (
    DISTINCTCOUNT ( ListadoArticulos[Descripcion Articulo] );
    FILTER (
        ALLSELECTED(ListadoArticulos[Descripcion Articulo]  );
        [**bleep** totalArti] < [80%sales]
    )
)

 

80%sales = CALCULATE([Ventas Netas];ALLSELECTED(ListadoArticulos[Descripcion Articulo]))*0,8

 

 

Thank for your time.

 

My best regards

 

Juan Diego

1 ACCEPTED SOLUTION

Hi @v-chuncz-msft

 

Thank you for your help. The problem was in the filter, the content is ok, i changed the measure for avoid the values equal to zero.

 

Number of Top 80% products =
CALCULATE (
    DISTINCTCOUNT ( ListadoArticulos[Descripcion Articulo] );
    FILTER (
        ALLSELECTED(ListadoArticulos[Descripcion Articulo]  );
        AND([**bleep** totalArti] < [80%sales],[**bleep** totalArti] >0),
    )
)

 

Again, thank you for your time.

 

regards

 

Juan Diego

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@JdBernate,

 

Try using ALLSELECTED Function instead of ALL Function in the cumulative measure as well.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chuncz-msft

 

Thank you for your help. The problem was in the filter, the content is ok, i changed the measure for avoid the values equal to zero.

 

Number of Top 80% products =
CALCULATE (
    DISTINCTCOUNT ( ListadoArticulos[Descripcion Articulo] );
    FILTER (
        ALLSELECTED(ListadoArticulos[Descripcion Articulo]  );
        AND([**bleep** totalArti] < [80%sales],[**bleep** totalArti] >0),
    )
)

 

Again, thank you for your time.

 

regards

 

Juan Diego

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.