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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Power BI DAX

=aggr(if(rank((Sum({<PARTS_TYPE={'Wholegoods'},SHIP_FROM_ORGANIZATION_NAME={'IM','ID'},DATE_TYPE={'ORDERED_DATE'},CYTD={'1'},FiscalMonth=,FiscalQuarter=,FiscalYear=>}OPEN_VALUE_GBP))
+(Sum({<PARTS_TYPE={'Wholegoods'},SHIP_FROM_ORGANIZATION_NAME={'IM','ID'},DATE_TYPE={'ORDERED_DATE'},CYTD={'1'},FiscalMonth=,FiscalQuarter=,FiscalYear=>}GOODS_VALUE_GBP)))<=10,
CUSTOMER_NAME, 'Other'), CUSTOMER_NAME)

 

 

I want to replicate this calculation, but I don't think I can show the result of this QlikView calculation as it contains sales company figures so it is confidential 

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

Hi @Anonymous ,

 

You could try the following DAX:

_DAX =
VAR a =
    CALCULATE (
        SUM ( 'Table'[OPEN_VALUE_GBP] ),
        FILTER (
            'Table',
            'Table'[PARTS_TYPE] = 'Wholegoods'
                && 'Table'[SHIP_FROM_ORGANIZATION_NAME] IN { 'IM', 'ID' }
                && 'Table'[DATE_TYPE] = 'ORDERED_DATE'
                && 'Table'[CYTD] = '1'
        )
    )
VAR b =
    CALCULATE (
        SUM ( 'Table'[GOODS_VALUE_GBP] ),
        FILTER (
            'Table',
            'Table'[PARTS_TYPE] = 'Wholegoods'
                && 'Table'[SHIP_FROM_ORGANIZATION_NAME] IN { 'IM', 'ID' }
                && 'Table'[DATE_TYPE] = 'ORDERED_DATE'
                && 'Table'[CYTD] = '1'
        )
    )
RETURN
    TOPN ( 10, 'Table', a + b, ASC )

Then you could use IF() statement to get the correct "CUSTOMER_NAME".

 

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

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could try the following DAX:

_DAX =
VAR a =
    CALCULATE (
        SUM ( 'Table'[OPEN_VALUE_GBP] ),
        FILTER (
            'Table',
            'Table'[PARTS_TYPE] = 'Wholegoods'
                && 'Table'[SHIP_FROM_ORGANIZATION_NAME] IN { 'IM', 'ID' }
                && 'Table'[DATE_TYPE] = 'ORDERED_DATE'
                && 'Table'[CYTD] = '1'
        )
    )
VAR b =
    CALCULATE (
        SUM ( 'Table'[GOODS_VALUE_GBP] ),
        FILTER (
            'Table',
            'Table'[PARTS_TYPE] = 'Wholegoods'
                && 'Table'[SHIP_FROM_ORGANIZATION_NAME] IN { 'IM', 'ID' }
                && 'Table'[DATE_TYPE] = 'ORDERED_DATE'
                && 'Table'[CYTD] = '1'
        )
    )
RETURN
    TOPN ( 10, 'Table', a + b, ASC )

Then you could use IF() statement to get the correct "CUSTOMER_NAME".

 

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors