DAX Calculate Efficiency of Filter on Fact vs. Related Table

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
I have a fact file containing a column of measures and corresponding values, for example,

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Measure[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Volume[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]70[/TD]
[/TR]
[TR]
[TD]Cost[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]

This is repeated for thousands of transactions across many months - so my table is a few hundred thousand rows.

I want to write measures for each of the "Measures" in my fact file, for instance

Sum of Volume
Sum of Revenue
Sum of Cost

Is it more efficient to do this

= CALCULATE( SUM( Fact[Value] ), Fact[Measure] = "Volume" )

or better to create a related table of the list of unique Measures

Volume
Revenue
Cost

And then write my calculate formula as

= CALCULATE ( SUM Fact[Value], RelatedMeasuresTable[Measure] = "Volume" )

Is one more efficient than the other?

Thanks
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I'm struggling to see the benefit of the latter approach. Why would that be quicker?

A couple of hundred thousand rows should be no problem anyway.
 
Upvote 0
I'm struggling to see the benefit of the latter approach. Why would that be quicker?

A couple of hundred thousand rows should be no problem anyway.

I just wasn't sure - I thought I read somewhere that filtering on a related table containing just the unique values was supposed to be better than filtering on the fact table containing many duplicates in a given column. Maybe it doesn't matter much in this case. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top