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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic value lookup

Hi, I am doing some analysis on the Google Search data and it involves looking for "new" keywords used in google search in a specified time frame selected from date slicer.

 

For Eg: 

Keyword table: 

Date                      Keyword       Clicks     Impressions     CTR

23th Jan '20          K3                 1,000        8,920              xxx

16th Feb '20          K2                 1,000        8,920              xxx

10th May'20          K1                 1,000        8,920              xxx

  3rd June '20        K2                 1,000        8,920              xxx

 

 

 

Report: Selected time range: Last 90 days (16th March' 20- 16th June'20). Find all those keywords which are there In the selected time range but not found for any time range before this (start date in the table to 15th March'20)

 

Required Output:

Date                      Keyword       Clicks     Impressions     CTR

10th May'20          K1                 1,000        8,920              xxx

 

Please let me know if it is doable in PowerBI and how?

 

Thanks

Shubham

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your decription, I created data to reproduce your scenario. The pbix file is attached in the end.

Keyword:

d1.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

There is no relationship between two tables. You may create a measure as below.

Visual Control = 
var _date = SELECTEDVALUE(Keytword[Date])
var _keyword = SELECTEDVALUE(Keytword[Keyword])
return
IF(
    _date in DISTINCT('Calendar'[Date])&&
    COUNTROWS(
        FILTER(
            ALL(Keytword),
            NOT(Keytword[Date] in DISTINCT('Calendar'[Date]))&&
            Keytword[Keyword] = _keyword
        )
    )=0,
    1,0
)

 

Finally you need to put the measure in the visual level filter and use the 'Date' column from 'Calendar' table to filter the result.

d2.png

 

Best Regards

Allan

 

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

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your decription, I created data to reproduce your scenario. The pbix file is attached in the end.

Keyword:

d1.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

There is no relationship between two tables. You may create a measure as below.

Visual Control = 
var _date = SELECTEDVALUE(Keytword[Date])
var _keyword = SELECTEDVALUE(Keytword[Keyword])
return
IF(
    _date in DISTINCT('Calendar'[Date])&&
    COUNTROWS(
        FILTER(
            ALL(Keytword),
            NOT(Keytword[Date] in DISTINCT('Calendar'[Date]))&&
            Keytword[Keyword] = _keyword
        )
    )=0,
    1,0
)

 

Finally you need to put the measure in the visual level filter and use the 'Date' column from 'Calendar' table to filter the result.

d2.png

 

Best Regards

Allan

 

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

Anonymous
Not applicable

Thanks @v-alq-msft for the detailed solution. It is exactly what I need. !!

tex628
Community Champion
Community Champion

Hi @Anonymous 

I'm assuming that you have a table with your keywords and a slicer set on the last 90 days. If you have this you should be able to create the following measure which should return the amount of references these keywords have before the 90 days selection.

Measure = 
VAR minDate = MIN(Calendar[Date])
Return
IF( COUNTROWS(Maintable) = 0 , BLANK() ,
CALCULATE( COUNTROWS(MainTable) , ALL(Calendar) , Calendar[Date]<minDate )
)

 

Once you have the correct amount of references you should just be able to add a visual level filter to only display the ones with a measure value of 0. 

Br,
J



 


Connect on LinkedIn
jthomson
Solution Sage
Solution Sage

If your data's sorted by date, you could try adding an index by group (method is easily searchable), so for example on your sample data you'd have an additional column that went 1, 1, 1, 2 - it's easy enough to filter on 1 from there

Anonymous
Not applicable

Hi, I have used K1, K2 just as examples here in place of actual queries people type into google search. It can be anything, from a single word to even a sentence. Indexing by grouping is not possible

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.