cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Martin_Songstad
Frequent Visitor

Reusing measure within object

Hi!

 

For comparative analysis I would like to present a table like this:

 

Martin_Songstad_0-1659107555620.png

 

My 4 column measures are fractions, with 4 slightly different but easily calculated numerator background measures, and a common but heavily calculated denominator background measure. So I would like this denominator background measure to calculate only once per segment, but suspect it happens 4 times, one time per measure - does it? Is there a more efficient way to actually reuse a calculation needed in several different measures shown simultaniously?

4 REPLIES 4
v-kalyj-msft
Community Support
Community Support

Hi @Martin_Songstad ,

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

 

Best Regards,
Community Support Team _ kalyj

johnt75
Super User
Super User

It will be calculated for each measure for each segment and I don't believe there is a way around that using measures. The only way would be to store the calculation in a table, but that would not be affected by slicers or filters on the visuals. If the denominator is not affected by slicers and does not need to be dynamic then storing it in a table is definitely an option. 

If it is affected by slicers, you still might be able to precompute the values for all possible combinations of slicer values, and store that in a table, if there is a reasonable number of combinations. It would increase data load time, when all the calculations would have to be performed, but that would be invisible to report users.

Thanks, @johnt75 !

 

I found that I can get a similar result by using a matrix table and just the Churn_rate_Total measure if i tweak the common background demoninator measure by adding ALL/REMOVEFILTERS(Churn_types):

 

CALCULATE(

   SUM(.....),

  REMOVEFILTERS(Churn_types)

)

 

The visual result is quite the same, and I would hope that the denominator now only calculates once per segment - or does it still calculate per shown value? 

Certainly from a theoretical point of view you can see that caching would be an option, but I don't know enough about what happens in the background to be able to comment on whether caching would actually happen or not.

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors