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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
BudMan512
Helper V
Helper V

Two Measures - two different results

Hi All,

I am producing a Matrix that shows customer deliveries of fuel for each month of the year.

BudMan512_0-1687294577780.png

I also have a second page with various tables and graphs including one that sums the gallons by category (product). There are two different measures being used.  The 'Adj Qty' has the correct quantity for '01C Commercial Propane' and the other, 'Gallons', has the correct value for '01R Residential Propane'. Other values are correct.
BudMan512_1-1687294873380.png

I can't seem to get a measure to get the correct values for all products.

Here are the two measures. 

Adj Qty = SUMX(History,History[qty] * RELATED(category[inv_multiplier]))

Gallons = (SUMX(HISTORY, IF(History[HIST_TRAN_TYPE]= 5, [Adj Qty]  * -1,[Adj Qty])))

Could someone help with a measure that will provide the correct values for all products?

Here is the model.

Thanks much,

Bud

BudMan512_2-1687295653805.png

 

 

 

1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

You could add a measure like this:

Mixed Unit Value =
    CALCULATE (
        [Adj Qty],
        KEEPFILTERS ( category[CATEGORY] = "01C" )
    ) +
    CALCULATE (
        [Gallons],
        KEEPFILTERS ( category[CATEGORY] <> "01C" )
    )

It calculates measure [Adj Qty] for category 01C and [Gallons] for all other categories.

View solution in original post

1 REPLY 1
Martin_D
Super User
Super User

You could add a measure like this:

Mixed Unit Value =
    CALCULATE (
        [Adj Qty],
        KEEPFILTERS ( category[CATEGORY] = "01C" )
    ) +
    CALCULATE (
        [Gallons],
        KEEPFILTERS ( category[CATEGORY] <> "01C" )
    )

It calculates measure [Adj Qty] for category 01C and [Gallons] for all other categories.

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.