cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
nicolasvc
Helper III
Helper III

Add count for month

I have two columns, one with the date and the other in year-month format, and I want to add a third one that is a counter for each day that goes by, and when it is a new month that it restarts. I was able to do it in total, but not that it restarts per month, and I'm getting very complicated.

 

Date Month
2022/06/01 2022/06
2022/06/02 2022/06
......
2022/06/01 2022/07

 

Date Month count
2022/06/01 2022/06 1
2022/06/05 2022/06 2
.........
2022/06/01 2022/07 1
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @nicolasvc,

You can try to use the following measure formula to get the count based on the current date and current month group:

formula =
CALCULATE (
    COUNT ( Table[Date] ),
    FILTER ( ALLSELECTED ( Table ), [Date] <= MAX ( Table[Date] ) ),
    VALUES ( Table[Month] )
)

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

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @nicolasvc,

You can try to use the following measure formula to get the count based on the current date and current month group:

formula =
CALCULATE (
    COUNT ( Table[Date] ),
    FILTER ( ALLSELECTED ( Table ), [Date] <= MAX ( Table[Date] ) ),
    VALUES ( Table[Month] )
)

Regards,

Xiaoxin Sheng

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

Hi we wnat to help but please provide a lot more examples not just 3 dates and take care to avoid typing mistakes

 

Explain the missing dates. Why does it jump from 22/06/01 to 2022/06/05 ? 

 

And why is 2202/06/01 in month 2022/06 and  2022/07.   It does not make sense and looks like typing mistakes.

speedramps_1-1656621628934.png

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors