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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.