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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.