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

DAX Question: copy column value but change at certain interval (text)

I would like to copy the rows from the first column to the second. 

Whenever the logic comes to a row with "VC" I would like "VC" copied instead until the next "VC" value. 

Then, it returns to copying the row in the first column.

 

Column(Value to return)
XXXX
XXXX
XXXX
XXXX
VCVC
BYVC
BYVC
BYVC
BYVC
BYVC
VCVC
BYBY
BYBY
BYBY
BYBY
BYBY
VCVC
BYVC
XXVC
VCVC
XXXX
XXXX

 

8 REPLIES 8
Anonymous
Not applicable

Power Query is the tool to do such things... Please have a look:

 

https://1drv.ms/u/s!ApyQEauTSLtOgYMozxOFMkHiel9nYg?e=8az3Ym

 

Best

D

Anonymous
Not applicable

Can you send this to joshscha@gmail.com?

@Anonymous 

Anonymous
Not applicable

Again... Such things are easily performed in Power Query and should be performed there. DAX is not a data mashup language; it's a Data Analysis eXpressions language.

Best
D
Anonymous
Not applicable

@Anonymous

So interesting! I'll try as soon as I can and get back to you. 

 

Anonymous
Not applicable

I will give you logic just check for occurance of vc and increment it by 1.

So everytime we need to fill vc from odd to even.
Greg_Deckler
Community Champion
Community Champion

Having a hard time wrapping my head around the logic that is desired here. But, mabye something like Cthulhu: 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/td-p/509739



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I changed the discription a bit, maybe it's clearer. thanks. 

Anonymous
Not applicable

Hi @Anonymous 

 

Create one index column.

 

Then create below two columns

Rank =
VAr rank_check=RANKX(FILTER(Sheet4,Sheet4[Column]=EARLIER(Sheet4[Column])&&Sheet4[Column]="VC"),Sheet4[Index],,ASC)
return
IF(Sheet4[Column]="VC",rank_check,BLANK())
 
Output =
var final= IF(Sheet4[Rank]=BLANK(),CALCULATE(LASTNONBLANK(Sheet4[Rank],0),FILTER(Sheet4,Sheet4[Index]<EARLIER(Sheet4[Index]))))
return
IF(MOD(final,2)>0,"VC",Sheet4[Column])
 
 
Capture6.PNG
 
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Helpful resources

Announcements
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.