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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

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, @Anonymous 

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, @Anonymous 

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.