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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GunnerJ
Post Patron
Post Patron

Improving efficiency of a large measure

I have two measures that have to go through several "IF" statements to know which measure to use. They then use SUMX to get a grand total but as you can see below the dashboard actually just times out. My request to the community is to provide a more effecient way to get these grand totals or to limit the data. At the moment I'm a bit stuck on this issue.

GunnerJ_0-1666635896658.png

Summed Monthly Econ Benefit = 
   SUMX('Campaign Member', CALCULATE(
    if(SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Cross sell – Upgrade Internet", [Total Charges],
       IF( SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Cross sell – Paperless", 'Paperless Updates'[$ Monthly Paperless Benefit],
       IF(SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Cross sell – Bank Draft", [$ Monthly Bank Draft Benefit],
       IF(SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Acquisition – Residential", [Total First Go Charges],
       IF( SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Cross sell – EV Rate", [Monthly EV Benefit],
       IF(SELECTEDVALUE(Campaign[Campaign_Reason__c]) = "Cross sell – TOU rate", [Monthly TOU Benefit],
       "")
       ))))),
       FILTER(Campaign,
               Campaign[StartDate] >= DATE(2021, 7,29)
   )))

 

https://www.dropbox.com/s/akexa9amyqb6e6z/Marketing%20Campaigns%20Dashboard.pbix?dl=0

4 REPLIES 4
aj1973
Community Champion
Community Champion

Hi @GunnerJ 

aj1973_0-1666636622203.png

Add Variable to you measure

 

In another context, your model is way from being the best you can optimise, you need to better optimise it.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

@aj1973 thank you for the quick reply. With the variable I can only get a value to show if I select a single campaign. You are absolutely correct it needs to be optimized more and I was simply hoping to be fortunante that someone would see a "quick" fix to help improve overall performance. 

aj1973
Community Champion
Community Champion

It's normal to get values for the selected campaign because you're using SELECTEDVALUE in your measure.

To optimize your model it would need more than a quick fix on the fly, sorry 😔

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Thank you for the quick reply! I will continue to see if there's any way to choose between different measures to try and speed things up but I do appreciate the effort to help!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.