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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
bernate
Advocate I
Advocate I

Distinct count of products that fell into a category during a certain time period

Hello, I am trying to get a distinct count of products that fell into a category during a certain time period.

 

  • The "Archived" table contains the categories products fall into, depending on how they were classified at the time. The "Archived" table also has a Doc Version Date field based on when the document version went into effect. The Doc Version Date field contains duplicates because groups of categories are updated at once on one date.
  • The "Product" table contains product information and an initiation date. The Product ID and Initiation Date fields may contain duplicates.
  • The "Date Table" contains unique Date Key fields.

bernate_1-1713559004174.png

Product is connected to Date Table on DateTable.DtKey--->---Product.Initiation Date. Archived is connected to Date Table on Archived.DocVersionDate ---<>---DateTable.DtKey.

 

I want to know the distinct count of products that fell into a category during a certain time period. For example, between 2/21/2019 and 09/8/2019, there were 540 products that had an initiation date during that time. I want that number (540) displayed in the Doc Version Date of 02/21/19 because that's how many products were initiated before the new Doc Version on 09/09/2019.

bernate_2-1713559619476.png

Is there a simple way to do this using a measure, or would I have to alter something in my model or in Power Query to get this to work?

1 ACCEPTED SOLUTION

4 REPLIES 4
bernate
Advocate I
Advocate I

Hi, please try this link. I added the PBIX file and the Excel file where the tables come from. 

https://drive.google.com/drive/folders/1ueuzxnHDi8fnba03ijc74P0oHSIo6KYC?usp=sharing

 

Below is the result I am wanting in the second table visual.

bernate_0-1713802125117.png

 

lbendlin_0-1713993872633.png

 

 

Thank you for your help!

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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