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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Nico_Schulze
Frequent Visitor

Use every seventh row

Hey yall, 

 

I have an Column called "A" that has 100 Entries. In Column "B" I want to only use every seventh ROW, so ROW 7,14,21... 

 

Does someone know how I can do this? 

 

Thnak you very much for your help! 

 

Regards 

Nico

8 REPLIES 8
slorin
Super User
Super User

slorin
Super User
Super User

Hi

= Table.AlternateRows(Source,0,6,1)

Stéphane 

Hey @slorin , 

 

your solution seems easy. But when I try to write it down in my Power BI, it doesnt work. The function Table.AlternativeRows doesnt exist. What am I doing wrong? 

 

Thnaks for the help!

 

Regards

Nico

 

PhilipTreacy
Super User
Super User

Hi @Nico_Schulze 

 

Download example PBIX file

 

try this

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Jcy7EYAwEAPRXi4mYA/MpxaP+28DRps8Rdo5i1rbrI5HPOOIV7zjE9/I7vjGO/4xgAVMYAMjWGkr/VfWBw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"A", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Added Custom" = Table.AddColumn(#"Added Index", "B", each if Number.Mod([Index], 7) = 0 then [A] else "")
in
    #"Added Custom"

 

 

What you need to do is add an Index column and then use Number.Mod to check if the Index for that row leaves 0 remainder when divided by 7.  If so then use the value from A else use a ""

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

@Nico_Schulze 

 

What I mean is, in Column B rows 1 to 6, what do you want there?  A blank?

 

If you are adding another column, it has to have the same number of rows as all the other columns, so what do you put in the rows of that column from 1 to 6, 8 to 13 etc?

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hey @PhilipTreacy

 

sorry for the misunderstanding. Yes a Blank would be awesome! 

 

Regards 

Nico

PhilipTreacy
Super User
Super User

Hi @Nico_Schulze 

 

So what do you have in the other rows i.e. 1-6, 8-13 etc?

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hello Philip, 

 

in the other ROWS I also have Entries but they are not relevant for me. I only want to use every seventh Row. 

 

Regards

Nico

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors