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

Count the number of "in progress" products with an IN and a OUT date

Hi guys,

 

I have a table that looks like that :

 

SERIAL NUMBERTYPEDATE INDATE OUT
800A01/01/201703/01/2017
900B04/01/201706/01/2017

 

I would like to create a table that counts the number of products by type who are in "in progress" for each date, for example in this case :

 

DATETYPECOUNT
01/01/2017A1
01/01/2017B0
02/02/2017A1
02/02/2017B0
03/03/2017A1
03/03/2017B0
04/04/2017A0
04/04/2017B1
05/05/2017A0
05/05/2017B1
06/06/2017A0
06/06/2017B1

 

Would you have a solution ? 🙂

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @Anonymous,


Firstly, in Query Editor of Power BI Desktop, add a custom column named Alldays with the formula below.

{ Number.From([DATE IN])..Number.From([DATE OUT]) }
1.PNG

Secondly, expand the custom column and format its type to “Date”.
2.PNG

Thirdly, create a measure using DAX below and create Matrix visual using the measure and Alldays column, then use Alldays slicer to filter the Matrix visual. The Matrix visual will display the closest format as your desired result.

COUNT = COUNT(TEST[TYPE])
3.PNG

 
Regards,
Lydia Zhang

Community Support Team _ Lydia Zhang
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
v-yuezhe-msft
Employee
Employee

Hi @Anonymous,


Firstly, in Query Editor of Power BI Desktop, add a custom column named Alldays with the formula below.

{ Number.From([DATE IN])..Number.From([DATE OUT]) }
1.PNG

Secondly, expand the custom column and format its type to “Date”.
2.PNG

Thirdly, create a measure using DAX below and create Matrix visual using the measure and Alldays column, then use Alldays slicer to filter the Matrix visual. The Matrix visual will display the closest format as your desired result.

COUNT = COUNT(TEST[TYPE])
3.PNG

 
Regards,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks it does work 🙂

Anonymous
Not applicable

Would it be possible to use the same method with textcodes separated by a semicolon like this :

 

PIC122;PIC099;PIC156

 

 

Thanks 🙂

Hi @Anonymous,


Please open a new thread about the above issue since the thread has been closed.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.