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

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

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
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.