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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
joshs444444
Frequent Visitor

Top 10% Measure Issues

I have a DIM item table and a Fact purchse table.

I created a measure to calculate the 2022-2023 purchase spend for each item.


I am trying create another measure that calculates 10% of the 2022-2023 purchase spend.  I want this measure to stay the same for each item, so that it is a static value. I also want it to be recalculated based on the context of the items. So if it is top 10 items, it would be the sum of 10% of the purchase spend for each row, and if it is top 20 items, same thing.

 

Here is what I have now:

joshs444444_0-1685023831510.png

 

 

Total Purchases 2022-2023 =
CALCULATE(
    [Total Purchases],
    'Date'[Year] IN {2022, 2023}
)
 
Top10PercentSpend = CALCULATE( [Total Item Purchase Spend 2022-2023] * 0.1,
ALL('Item')
)
 
Top10PercentSpend item =
SUMX(
    SUMMARIZE(
        CALCULATETABLE(
            'Purchases',
            VALUES('Item'[Item #])
        ),
        'Item'[Item #],
        "TotalCost", [Total Item Purchase Spend 2022-2023]
    ),
    [Total Item Purchase Spend 2022-2023] * 0.1
)
 
 
---
the problem I am running into is getting just the context total. For example, the "Top10PercentSpend" measure is adding up 10% of all purchases no matter the context. However the Top10PercentSpend item measure is calculating the 10% spend for each item individually.

What I really want is the total of the "Top10PercentSpend item" measure in each row.
 
Any help is appreciated. I am happy to clarify or provide additional context.
 
Thanks!



0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.