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

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

Reply
Anonymous
Not applicable

Count the number of rows that share the same value

Hello!

 

I am trying to calculate how many of my keywords share the same position. I have a table that has 3 columns, Date, Keywords and Position.

Date         Keywords       Position

######    term 1            4

######    term 2            1

######    term 3            2

######    term 4            3

######    term 5            4

######    term 6            1

######    term 7            2

 

I am want to create a measure that returns the number of terms that share the same position

So the output will be like 5 terms on position 1, 2 terms on potions 2 etc...

 

Is this possible?

 

Thank you!

 

 

5 REPLIES 5
Sean
Community Champion
Community Champion

1) Create a Table Visual and drag Position and this Measure to it

Measure = DISTINCTCOUNT ( 'Table'[Keywords] )

2) You can also achieve the same result by draging Position and Keywords to a Table Visual

then right-click on Keywords in the Value area and change to Count(Distinct)

Count(Distinct).png

 

Anonymous
Not applicable

Thank you for your reply, Sean.

 

It is working. However, If a term is repeated in the column keyword and every time has a different position value, how this will work?

 

When I display the data by date the output is correct, by when I display the data by month, some values are counted more than once.

 

Regards

George

@Anonymous

 

If you build your date hierarchy properly, using DISTINCTCOUNT() will return correct result on different level. In this scenario, your calculation only need to group on POSITION level.

 

Measure = CALCULATE(DISTINCTCOUNT ( 'Table'[Keywords] ),ALLEXCEPT('Table',Table[Position]))

Regards, 

Sean
Community Champion
Community Champion

Can you provide some sample data and specify how exactly will the results be displayed? (you may need a count not distinct)

Count(Distinct) 4.gif

 

Anonymous
Not applicable

Hello Sean,

 

Thank you for sharing your GIF. I have managed to get the same results are you did.

Now I am trying to use a line chart to display the data, but it doesn't work.

 

I am trying to recreate the line chart we are using on our system in PowerBi which shows the number of keywords for each position per month. Ideally, i would like to have a chart that shows the footprint of one month and provide a visual comparison with the previous month. Like the example below.

 

footprint.JPG

 

My table looks like this

 

keywords.JPG

 

It included keywords that the site appears for every day and the position that it appeared for.

 

Eventually, i would like to see on a graph the number of keywords per position per day, week, month etc.

 

Regards

George

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.