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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Krijgersss
Helper II
Helper II

help with a date colum

Hello i need some help with a date Colum. i have a date colum that gives a date of a shop if its open. so if there is a date the shop will be open. how do i count the days in that colum that i know how many days each month the shop is open.

many thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Krijgersss ,

 

You can create calculated columns and write dax expressions:

Column =
CALCULATE(COUNT('Table'[date]),
FILTER(ALL('Table'),
EARLIER('Table'[date]) >= EOMONTH('Table'[date],-1)+1 && EARLIER('Table'[date]) <= EOMONTH('Table'[date],0) && ' Table'[date] <= EARLIER('Table'[date])))


The result obtained is shown below:

vkaiyuemsft_0-1709190814166.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Krijgersss ,

 

You can create calculated columns and write dax expressions:

Column =
CALCULATE(COUNT('Table'[date]),
FILTER(ALL('Table'),
EARLIER('Table'[date]) >= EOMONTH('Table'[date],-1)+1 && EARLIER('Table'[date]) <= EOMONTH('Table'[date],0) && ' Table'[date] <= EARLIER('Table'[date])))


The result obtained is shown below:

vkaiyuemsft_0-1709190814166.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

timalbers
Super User
Super User

Hi @Krijgersss  try something like this within a new measure:

new_measure = DISTINCTCOUNTNOBLANK( your_table[Date_column] )

 


—————————————————————————————
✔️ If my answer helped you, please consider marking it as a solution.

Thats not excatly what i want now it gives me only 1 by every date i want it to count so for example:

1-1-2024   1

2-1-2024   2

4-1-2024   3

5-1-2024   4
6-2-2024   1

7-2-2024   2

so in January the shop was 4 days open and in february the shop was 2days open

 

I wonder, how you would like to display this data.
If you want to display it in a table visual, then just add another calculated column to your data that gives you the month and then you could use this field in your table visual combined with the measure I posted. Then you will have the exact number of days found for every month.


—————————————————————————————
✔️ If my answer helped you, please consider marking it as a solution.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.