Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I am trying to take a certain amount and divide it on some unique products. I've looked in the Performance Analyzer and can see that this DAX query is specially heavy.
I have first
Measure A = CALCULATE(SUM(fact_distribution[frafall]);fact_distribution[Pristypekode] <> "Free")
Which is divided on
Measure B = COUNTROWS(GROUPBY(fact_distribution;fact_distribution[fk_dim_customer];fact_distribution[fk_dim_publication]))
Now from whtat I understand Measure B could be optimized to:
COUNTROWS(SUMMARIZECOLUMNS(fact_distribution[fk_dim_publication];fact_distribution[fk_dim_customer]))
But...this gives an error that says SummarizeColumns() and AddMissingItems() may not be used in this context.
Which from what I understand this is because of the filtering done in the calculate on Measure A?
Any other tips on how I can optimize it? I need to take Measure A and divide on Measure B to get a percentage, and then I also need that same percentage in a Last Year version.
Thanks for any help.
Best,
Ali A
Solved! Go to Solution.
Hi @Anonymous ,
You can use the following DAX:
COUNTROWS(SUMMARIZE(fact_distribution;fact_distribution[fk_dim_publication];fact_distribution[fk_dim_customer]))
Would yo like to provide some sample data? We can perform more accurate analysis based on it.
Hi @Anonymous ,
You can use the following DAX:
COUNTROWS(SUMMARIZE(fact_distribution;fact_distribution[fk_dim_publication];fact_distribution[fk_dim_customer]))
Would yo like to provide some sample data? We can perform more accurate analysis based on it.
Hi,
Out of curiosity - what is the difference? I will look it up online, but if you have a practical way of explaining that would be great.
Thanks for the response!
Best,
Ali A
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
89 | |
88 | |
82 | |
64 | |
49 |
User | Count |
---|---|
125 | |
111 | |
88 | |
69 | |
66 |