cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdbuzzer15
Helper I
Helper I

Refactoring DAX Query using USERELATIONSHIP

I have written this DAX query but it takes quite a long time to render, is there anyway I can refactor this to return the result on the card visual faster?

postVPP = 
VAR currentMonth = DATE(YEAR(today()), month(today()), 1)
RETURN
COALESCE (
    CALCULATE (
        DIVIDE ( [sumOfVendor], [Total Partners], 0 ),
        USERELATIONSHIP ( 'Channel Table'[partner_key], fact_transaction_monthly[transaction_monthly_partner_key] ),
        fact_transaction_monthly[transaction_monthly_charge_created_date] >= currentMonth
       
    ),
    0

mdbuzzer15_0-1670491786777.png

 

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

Hi, @mdbuzzer15 

I don't think this part can be further optimized.

This code is clear, understandable and maintainable enough.

You may need to check your current data model and other referenced mesures.

Best Regards,
Community Support Team _ Easo

 

 

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @mdbuzzer15 

I don't think this part can be further optimized.

This code is clear, understandable and maintainable enough.

You may need to check your current data model and other referenced mesures.

Best Regards,
Community Support Team _ Easo

 

 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.