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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Enter an unique index to each day

Hi guys,

 

i have the following table, datetime and a value, this pic shows only ne day August 7th however it has much more, 

edgarcalgary_0-1597346855601.png

I would like to get a cummulative count of each unique day in the table, for example August 7th gets 1, without caring for the time, then August 8th the 2 and so on, how can i achieve this?

 

Many thanks.

 

2 ACCEPTED SOLUTIONS

You should split the date/time into 2 columns during data load. You should also get a calendar table for more robust reporting. https://exceleratorbi.com.au/power-pivot-calendar-tables/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can try to use following calculate column formula if it meets your requirement:

Index=
COUNTROWS (
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS ( ALLSELECTED ( Table ), "Date", DATEVALUE ( Table[EndDateTime] ) ),
            [Date] <= EARLIER ( Table[EndDateTime] )
        ),
        [Date]
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can try to use following calculate column formula if it meets your requirement:

Index=
COUNTROWS (
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS ( ALLSELECTED ( Table ), "Date", DATEVALUE ( Table[EndDateTime] ) ),
            [Date] <= EARLIER ( Table[EndDateTime] )
        ),
        [Date]
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

I would use the  DATEDIFF('table'[EndDateTime],today(),DAY) and create a column, sounds good. 

 

Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!

 

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

You should split the date/time into 2 columns during data load. You should also get a calendar table for more robust reporting. https://exceleratorbi.com.au/power-pivot-calendar-tables/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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