Forum Discussion
Arvind123
2 years agoFrequent Visitor
Dax Query taking too much time.
Hi Team,
My dax is taking too much time to run it take approximately ~130000ms time.
I have used ad like to get keyword revenue greater than 500 by source and managemnet group wise.
Filtered Revenue > 500- =
VAR KeywordSourceTotalRevenue =
SUMMARIZE(
'BT3 Keyword',
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
'BT3 Keyword'[Source],
"SourceRevenue", CALCULATE(SUM('BT3 Keyword'[Total Revenue]))
)
VAR FilteredKeywordTotalRevenue =
SUMMARIZE(
FILTER(
KeywordSourceTotalRevenue,
CALCULATE(
SUM('BT3 Keyword'[Total Revenue]),
ALLEXCEPT('BT3 Keyword', 'BT3 Keyword'[Management Group], 'BT3 Keyword'[Month], 'BT3 Keyword'[Keyword])
) > 500
),
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
"FilteredKeywordTotalRevenue", CALCULATE(SUM('BT3 Keyword'[Total Revenue]))
)
RETURN
SUMX(FilteredKeywordTotalRevenue, [FilteredKeywordTotalRevenue])
Then I fetched adclicks
Then I fetched adclicks
Filtered Ad Clicks > 500- =
VAR KeywordSourceTotalRevenue =
SUMMARIZE(
'BT3 Keyword',
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
'BT3 Keyword'[Source],
"SourceRevenue", CALCULATE(SUM('BT3 Keyword'[Total Revenue]))
)
VAR FilteredKeywordTotalRevenue =
SUMMARIZE(
FILTER(
KeywordSourceTotalRevenue,
CALCULATE(
SUM('BT3 Keyword'[Total Revenue]),
ALLEXCEPT('BT3 Keyword', 'BT3 Keyword'[Management Group], 'BT3 Keyword'[Month], 'BT3 Keyword'[Keyword])
) > 500
),
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
'BT3 Keyword'[Source],
"FilteredAdClicks", CALCULATE(SUM('BT3 Keyword'[Ad Click]))
)
RETURN
SUMX(FilteredKeywordTotalRevenue, [FilteredAdClicks])
after than I find RPC
=[Filtered Revenue > 500-]/[Filtered Ad Clicks > 500-]
then I find out the Count of source
after than I find RPC
=[Filtered Revenue > 500-]/[Filtered Ad Clicks > 500-]
then I find out the Count of source
Filtered Source Count > 500- =
VAR KeywordSourceTotalRevenue =
SUMMARIZE(
'BT3 Keyword',
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
'BT3 Keyword'[Source],
"SourceRevenue", CALCULATE(SUM('BT3 Keyword'[Total Revenue]))
)
VAR FilteredKeywordTotalRevenue =
SUMMARIZE(
FILTER(
KeywordSourceTotalRevenue,
CALCULATE(
SUM('BT3 Keyword'[Total Revenue]),
ALLEXCEPT('BT3 Keyword', 'BT3 Keyword'[Management Group], 'BT3 Keyword'[Month], 'BT3 Keyword'[Keyword])
) > 500
),
'BT3 Keyword'[Management Group],
'BT3 Keyword'[Month],
'BT3 Keyword'[Keyword],
'BT3 Keyword'[Source]
)
RETURN
COUNTROWS(FilteredKeywordTotalRevenue)
Then I intrduce all of them in using calculation group.
and after that it is taking too much time to display for selection of single management group
and if I want to check it without filter i.e, for overall then
it giving me an error like "visual has exceeded available resources".
Please suggest me what to do in this case.
Then I intrduce all of them in using calculation group.
and after that it is taking too much time to display for selection of single management group
and if I want to check it without filter i.e, for overall then
it giving me an error like "visual has exceeded available resources".
Please suggest me what to do in this case.
Regards,
Arvind
1 Reply
- lbendlinSuper User
You're holding it wrong. Please read this article
All the secrets of SUMMARIZE - SQLBI
Then refactor your queries.