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
Hystericred
Frequent Visitor

Extract date (in the text format) from a list ( { .... , .... , .... } ) then count using DAX

Hi,

I'm new to the community : ) I'd like to know if you guys could help me on this.

I have created 2 tables 1) date table running from 1-Jan-2020 to 31-Jan-2020 2) table with 3 columns : ID, Start_Date , and End_Date > and extracted a date list between Start_Date and End_Date in power query using custom column formula {[Start_Date]..[End_Date]}. Let's call this below table "Example1"

IDStart DateEnd DateDate List
143831 (this is 1-Jan-2020)43840 (this is 10-Jan-2020)43831:43832:43833:43834:43835:43836:43837:43838:43839:43840
243831 (this is 1-Jan-2020)43834 (this is 4-Jan-2020)43831:43832:43833:43834


I want to know if it's possible to write DAX to
1. create calculated culumn in the date table that able to see all the date value inside the lists under Date List column
2. then count for how many x date this calculated field function see running through the column and ignore to count the last item in the list

 

In this case, the resulut should be :

1-Jan-20 = 2
2-Jan-20 = 2
3-Jan-20 = 2
4-Jan-20 = 1
5-Jan-20 = 1
6-Jan-20 = 1
7-Jan-20 = 1
8-Jan-20 = 1
9-Jan-20 = 1
10-Jan-20 = 0

I have a feeling that making a measure or doing it in power query might be more appropriate than the calculated column - I'm not sure.

  

Thank you in advance.

Chadil.B

 

1 ACCEPTED SOLUTION

Hi Chadil.B,

 

Based on your requirements, I suggest you create a new datelist(datelist1 in my sample) column that does not contain enddate:

 

CALCULATE(COUNTROWS(Example1), FILTER( 'Example1',SEARCH('Date'[date], 'Example1'[datelist1],,0)>0))+0

 

Untitled picture3.png

 

 For more details, please refer to pbix :https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EeWRSs3-k0pGtrX0gq...

 

Best Regards,

Dedmon Dai

 

View solution in original post

7 REPLIES 7
v-deddai1-msft
Community Support
Community Support

Hi Chadil.B,

 

According to your description, my understanding is that you want to create a calculated column to count rows that <Date List> contain 43831(

1-Jan-2020) If anything is misunderstood, please tell me.

 

Would you please try to use the following dax to create calculated column:

 

COUNT =

CALCULATE (

COUNTROWS ( 'Example1' ),

FILTER ( 'Example1', SEARCH ( 43831, 'Table'[Date List] ) <> BLANK () )

)

 

Untitled picture1.png

 

Best Regards,

Dedmon Dai

 

@v-deddai1-msft Hi Dedmon - Not sure about it. Please revisit the question - I have just edited - hope it is clearer.

 

Hi Chadil.B,

 

Based on your requirements, I suggest you create a new datelist(datelist1 in my sample) column that does not contain enddate:

 

CALCULATE(COUNTROWS(Example1), FILTER( 'Example1',SEARCH('Date'[date], 'Example1'[datelist1],,0)>0))+0

 

Untitled picture3.png

 

 For more details, please refer to pbix :https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EeWRSs3-k0pGtrX0gq...

 

Best Regards,

Dedmon Dai

 

@v-deddai1-msft thank you very much - allow me sometimes to test it, will get back to you for any updates.

 

any update?

Greg_Deckler
Community Champion
Community Champion

Maybe, what is the reference date for your date numerical values? For example, Unix is 1/1/1970. DAX is 12/30/1899. 

 



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...
amitchandak
Super User
Super User

Refer, if this can help

https://community.powerbi.com/t5/Desktop/Converting-UNIX-time-to-Date-in-PowerBI-for-Desktop/td-p/13...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.