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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Sasha
Helper III
Helper III

Count number of products over time

Hi,

 

I have a table of Products with each having an expiaration date.

Also, I have a table of Time dimension.

How can I define a measure counting all the products that are not expired over time?

Also, how can I present it on a graph showing only the 1st of each month using time dimension?

 

Thank you,

Alex

1 ACCEPTED SOLUTION

Hi @Sasha,

 

I made one sample based on your data.

 

1. Enter the data and create calculated table.

 

Table = CROSSJOIN('date',Table1)

2. Create a visual as below.

 

Capture.PNG

Also please find the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi

 

How the relationship is defined here? Which column is connected to Time dimension?

 

When you say "ounting all the products that are not expired over time" - is it for any specific date or period?

 

Would be easy to help you if you post some sample data and expected result in copy - pasteable format.

 

Thanks
Raj

Hi,

the relationship is between time dimension and expiration dates on the products table

Sample

 

Products Result expected
     
ProductExpiration date DateNot expired products
A31/12/2017 01/11/20173
B13/06/2018 01/12/20173
C02/07/2018 01/01/20182
   01/02/20182
   01/03/20182
   01/04/20182
   01/05/20182
   01/06/20182
   01/07/20181
   01/08/20180

Hi @Sasha,

 

I made one sample based on your data.

 

1. Enter the data and create calculated table.

 

Table = CROSSJOIN('date',Table1)

2. Create a visual as below.

 

Capture.PNG

Also please find the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Further drill down:

what if I want to turn this table into stacked chart area.

I would like then press on a month on the chart and get a table of all the products' names that are not expired at that point

It works with pressing on a table, it doesn't work when pressing on the chart (the table of products remains the same)

Thanks 

Alex

Thanks! It exactly what I was looking for!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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