Forum Discussion
Is this Dynamic Value segmentation?
Hello !
I am facing an issue, I'm sure the solution is simple, but lacking the knowledge I'm struggling to find the right way to do it.
Here's the setup:
I have a table with a list of "Keywords", each keyword is tracked for several brands on a weekly basis.
So each week, for each brand, every keywords is duplicated and we get the "Rank" of the brand on the keyword.
Like so:
| Brand | Keyword | Rank |
A | Label | 3 |
| A | Tutorial | 2 |
| B | Label | 43 |
| B | Tutorial | 4 |
| C | Label | 6 |
| C | Tutorial | 21 |
(without the date (week) column in the example)
I want to create the followying table filtered for only one Brand :
| Rank Intervals | Number of Keywords |
| 1 to 3 | 123 |
| 4 to 6 | 234 |
| 7 to 10 | 345 |
| 11 to 20 | 456 |
| 21 to 49 | 567 |
| 50+ (not ranked) | 678 |
The total number of keyword needs to match the total distinct number of keywords;
To do so, because the rank changes everyweek for a keywords, we need to calculate the AVERAGE rank of the keywords on the selected period and dynamicaly segment it in the right segment!
Keywords, rank, brand and weeks are in the same table.
Calendar table is used.
I have created a table with intervals with min and max columns.
I also tried this measure (found on the community) however, it used the column "rank" as is, instead of doing an average? And thus One keyword is counted several times in several segments (if we select a 1 year date range for example)
Calculate (DISTINCTCOUNT('Rankings Evolution'[Keyword]),
FILTER(
VALUES('Rankings Evolution'[Rank avg]),
COUNTROWS(
FILTER(Intervals,
'Rankings Evolution'[Rank avg] >= Intervals[Min]
&&
'Rankings Evolution'[Rank avg] < Intervals[Max]
))>0))
Thank you in advance!!
Best,
BT
Hi ING_BT ,
Based on the description you have you need to do a measure similar to this one:
Count Words on ranking = VAR temptable = SUMMARIZE ( words, Words[Brand], Words[Keyword], "AVerageRanking", AVERAGE ( Words[Rank] ) ) RETURN COUNTROWS ( FILTER ( temptable, [AVerageRanking] <= MAX ( Ranking[End] ) && [AVerageRanking] >= MIN ( Ranking[Start] ) ) )I have added some words counts on the Brand A and has you can see the total word count is 2 always:
Be aware that this calculation is at a brand level if your try to do it with all brands at all ranking the calculation is incorrect has you can see in the Total column below
10 Replies
- MFelixSuper User
Hi ING_BT ,
Based on the description you have you need to do a measure similar to this one:
Count Words on ranking = VAR temptable = SUMMARIZE ( words, Words[Brand], Words[Keyword], "AVerageRanking", AVERAGE ( Words[Rank] ) ) RETURN COUNTROWS ( FILTER ( temptable, [AVerageRanking] <= MAX ( Ranking[End] ) && [AVerageRanking] >= MIN ( Ranking[Start] ) ) )I have added some words counts on the Brand A and has you can see the total word count is 2 always:
Be aware that this calculation is at a brand level if your try to do it with all brands at all ranking the calculation is incorrect has you can see in the Total column below
- ING_BTHelper I
Hello Félix,
Thank you so much for your help! Your solution is very clear and It works perfectly. And thank you for very detailed explanation.
I spend hours to solution this, you cannot imagine the relief! I understand the logic now (thank you for naming it "temptable", makes it so obvious now!)
All the best,BT