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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Create Measure: Show Datesinbetween open and closed date and distinctcount the value

Hello Team,

I need your help in writing a measure for calculating daily count of items.

Here's the sample data

ItemOpendateCloseddate
A7/20/20207/22/2020
B7/20/20207/20/2020
C7/21/20207/27/2020

 

I need to create virtual table like this and get result from this below table

ItemOpendateCloseddate
A7/20/20207/22/2020
A7/21/20207/22/2020
A7/22/20207/22/2020
B7/20/20207/20/2020
C7/21/20207/27/2020
C7/22/20207/27/2020
C7/23/20207/27/2020
C7/24/20207/27/2020
C7/25/20207/27/2020
C7/26/20207/27/2020
C7/27/20207/27/2020

In the above table i need to add dates for Item until its closed.

 

So, the measure has to calculate distinct count of items in each opendate.

Resultset or measure value(Distinct count on each opendate)

Opendatedistinctcount of items
7/20/20202
7/21/20202
7/22/20202
7/23/20201
7/24/20201
7/25/20201
7/26/20201
7/27/20201

 

 

Please suggest me DAX measure to achieve this,

Thank you.

3 REPLIES 3
Anonymous
Not applicable

In DAX, there are no virtual tables. There are tables, calculated tables and table variables. What do you really want then?
amitchandak
Super User
Super User

@Anonymous ,

Check if this file can help

https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0

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
Anonymous
Not applicable

Thank you @amitchandak for your response.

But the count seems to be incorrect in my case.

ItemOpendateCloseddateCategorycode
A7/20/20207/22/2020salesx
A7/21/20207/22/2020salesx
A7/22/20207/22/2020salesx
B7/20/20207/20/2020Purchasey
C7/21/20207/27/2020purchasey
C7/22/20207/27/2020purchasex
C7/23/20207/27/2020purchasex
C7/24/20207/27/2020purchasex
C7/25/20207/27/2020purchasex
C7/26/20207/27/2020purchasey
C7/27/20207/27/2020purchasey

But I forgot to mention if "closed date" is null, add date to opendate until the item is closed and also get the distintinct count by including category column while summarizing.

Please let me know your suggestions.!

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.