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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Add value to only one distinct date

I want to add a "1" in the beginning of each day and only once. 

rmd_date  I want to create this column
12-04-2023  0
12-04-2023  1
11-04-2023  0
11-04-2023  0
11-04-2023  1
10-04-2023  1
9-04-2023  0
9-04-2023  0
9-04-2023  1

 

7 REPLIES 7
DOLEARY85
Resident Rockstar
Resident Rockstar

Okay to do this:

 

First i would sort the order of you date field ascending then add an index in power query.

 

then create a column in DAX:

 

Column 2 =
IF (CALCULATE (COUNTROWS ('Table (4)'),FILTER (ALLEXCEPT ( 'Table (4)', 'Table (4)'[Date] ),'Table (4)'[Index] <= EARLIER ('Table (4)'[Index] )))> 1, 0, 1)
 
DOLEARY85_0-1681302779286.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Anonymous
Not applicable

Thank you for your resposse. It however doesn't seem to work...
My line:

IF( CALCULATE( COUNTROWS( MG_casing_record, FILTER( ALLEXCEPT (MG_casing_record, MG_casing_record[rmd_date]), MG_casing_record[id] <= EARLIER (MG_casing_record[id]))) > 1, 0, 1))

It gives me this warning: "Too many arguments were passed to the COUNTROWS function. The maximum argument count for the function is 1."

Hmmm okay, try changing the COUNTROWS  to COUNT

Anonymous
Not applicable

This also doesn't seem to work... Could you send me the PBI-file? 🙂

I don't seem to be able to share the file, i'm getting an unsupported message. Do you have a share drive i can drop it in?

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi, you could use a calculated column with DAX,

 

i've assumed the 1 and 0 depends on whether you want a day adding or not if so:

 

Column = if(VALUE('Table (4)'[Value])=1,DATEADD('Table (4)'[Date],1,DAY))
 
DOLEARY85_3-1681301132829.png

 

 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Anonymous
Not applicable

Thank you. I have updated the question. Hope it makes more sense now 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors