This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi Everyone,
I am trying to find the distinct count of products for the months of Jan - May 24, but if the product appeared in Jan this should not be counted in Feb, Mar, Apr, May.
After the first occurance it should not be counted in the time series. Is this possible in Power BI?
Thanks v much in advance.
Solved! Go to Solution.
Hi @PBIuser_2024 you can create a measure with first month occurrance as below:
FirstMonthOccurrence =
CALCULATE(
MIN('DateTable'[MonthYear]),
ALLEXCEPT('Sales', 'Sales'[Product])
)
to get the distinct product by month which is not repeated in existing month, create one more new measure
DistinctProductsByMonth =
VAR SelectedMonthYear = MAX('DateTable'[MonthYear])
RETURN
CALCULATE(
DISTINCTCOUNT('Sales'[Product]),
FILTER(
'Sales',
[FirstMonthOccurrence] = SelectedMonthYear
)
)
drag the above measure and check each product is counted only in its first occurrence month and not in subsequent months.
Regards,
Rajendra
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Proud to be a Super User! | |
thanks @rajendraongole1
I get a "Visual has exceeded the available resources" error message using the measure.
Hi @PBIuser_2024 you can create a measure with first month occurrance as below:
FirstMonthOccurrence =
CALCULATE(
MIN('DateTable'[MonthYear]),
ALLEXCEPT('Sales', 'Sales'[Product])
)
to get the distinct product by month which is not repeated in existing month, create one more new measure
DistinctProductsByMonth =
VAR SelectedMonthYear = MAX('DateTable'[MonthYear])
RETURN
CALCULATE(
DISTINCTCOUNT('Sales'[Product]),
FILTER(
'Sales',
[FirstMonthOccurrence] = SelectedMonthYear
)
)
drag the above measure and check each product is counted only in its first occurrence month and not in subsequent months.
Regards,
Rajendra
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Proud to be a Super User! | |
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 45 | |
| 28 | |
| 24 | |
| 22 |