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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sheorans352_1
New Member

Create Measure to be used for Slicer and Filter

sheorans352_1_0-1721825895530.png

I have Kwywords and URL in Site Link May/Jun table 

I have Unique Pages/Queries

 I have page and keywords performace in Clicks, CTR and rank in DS Page And Query Table
Now I want to see URL which are appearing in sitelinks
Logic to determine URL are in site link 
Step 1: Check the Keyword in Sitelink Jun/May table (if keywords is present in table then Yes otherwise Keywords did not have site link on SERP)
Step 2: Find out URL that are in sitelink and URL that is on main ranking. (Multiple URLs ranking on same position and URL with highest CTR out of those is main URL, URLs other than highest CTR URL are links appearing in sitelink for the query)

I want to create a Slicer Named With Sitelink or W/O sitelink
whcih should give me clicks number for a URL from sitelink (sitelink can be for many queries) 
 

1 REPLY 1
sandrika
New Member

1. Create Calculated Column to Identify Keywords in Site Link Tables:
KeywordInSiteLink =
IF(
CONTAINS('Site Link Jun', 'Site Link Jun'[Keyword], 'DS Page And Query Wise'[Query]) ||
CONTAINS('Site Link May', 'Site Link May'[Keyword], 'DS Page And Query Wise'[Query]),
"Yes",
"No"
)
2. Create Measures to Determine Main URL and Site Link URLs:
Main URL Measure:
MainURL =
VAR SelectedURL = 'DS Page And Query Wise'[Landing Page]
VAR MaxCTR =
CALCULATE(
MAX('DS Page And Query Wise'[CTR]),
FILTER(
ALL('DS Page And Query Wise'),
'DS Page And Query Wise'[Query] = SELECTEDVALUE('DS Page And Query Wise'[Query])
)
)
RETURN
IF(
'DS Page And Query Wise'[CTR] = MaxCTR,
SelectedURL,
BLANK()
)
Site Link URLs Measure:
SiteLinkURLs =
VAR SelectedURL = 'DS Page And Query Wise'[Landing Page]
VAR MaxCTR =
CALCULATE(
MAX('DS Page And Query Wise'[CTR]),
FILTER(
ALL('DS Page And Query Wise'),
'DS Page And Query Wise'[Query] = SELECTEDVALUE('DS Page And Query Wise'[Query])
)
)
RETURN
IF(
'DS Page And Query Wise'[CTR] < MaxCTR,
SelectedURL,
BLANK()
)
3. Create a Slicer:

SitelinkFilter =
IF(
'DS Page And Query Wise'[KeywordInSiteLink] = "Yes",
"With Sitelink",
"Without Sitelink"ClicksFromSiteLinks =
CALCULATE(
SUM('DS Page And Query Wise'[Clicks]),
FILTER(
'DS Page And Query Wise',
'DS Page And Query Wise'[SitelinkFilter] = "With Sitelink"
)
)

)
4. Visualize Clicks for URLs from Site Links:
ClicksFromSiteLinks =
CALCULATE(
SUM('DS Page And Query Wise'[Clicks]),
FILTER(
'DS Page And Query Wise',
'DS Page And Query Wise'[SitelinkFilter] = "With Sitelink"
)
)


Use the provided DAX code to create the necessary calculated columns and measures in the appropriate tables. Add a slicer visual to your report and use the 'SiteLinkFilter' column for filtering.Use the 'ClickFromSiteLinks' measure to display clicks for URLs from site links in a card or table visual. Use other visuals as needed to display URLs, CTR, and other metrics based on the slicer selection.



 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.