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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
khacwee
Frequent Visitor

Which ways are more efficient comparing between having a Measure in DAX formula or using VAR?

Dear all,

 

I have a performance related questions regarding which ways are more efficient and less resources consuming in Power BI for below?

 

Option 1: Having 3 Measures in total

Factor = calculate(sum(factor),filter(factortable,date>=min(timetable) && date<=max(timetable)))

Sales = calculate (sum(sales),filter(salestable,date>=min(timetable) && date<=max(timetable)))

Actual Sales = Sales * Factor

 

Option 2: Use only one measure, the other 2 measures will be VAR within the desired measure

Actual Sales =

var factor = calculate(sum(factor),filter(factortable,date>=min(timetable) && date<=max(timetable)))

var sales = calculate (sum(sales),filter(salestable,date>=min(timetable) && date<=max(timetable)))

return factor*sales

 

The resulting visuals will be a table with Branches as rows and Actual Sales as column:

 

BranchesActual Sales
Branch A10,000
Branch B15,000
Branch C20,000
Branch D25,000

 

I have been wondering which way is more efficient as I am encountering limit per query issues in a complex visual.

Please help to advise, Thanks!

 

Wee

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @khacwee ,

 

Regarding your question, both options are valid and efficient. However, the second option is more efficient in terms of performance because it uses only one measure instead of three measures.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @khacwee ,

 

Regarding your question, both options are valid and efficient. However, the second option is more efficient in terms of performance because it uses only one measure instead of three measures.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

sergej_og
Super User
Super User

It seems to me "Option 1" is good to go in this case.
You can use every single measure (once created) over and over again for other purposes in your business logic...maybe tweek a bit better for performance issues.
As @some_bih mentioned using FILTER might be not best practice.
Try to avoid if you run into performance issues.

Regards

some_bih
Super User
Super User

Hi @khacwee seems that you use filter filter(salestable,date in both option. This is not best practice as salestable is big table (many rows). Think about changing this part, as we assumy that factor table is very little one compared with salestable.

Hope this help, kudos appreciated.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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