Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi!
I need to count unique number of products that were in the assortment, for example, in January and are now. I can't do normally: calculate(DISTINCTCOUNT(Assort[ProductId]),month(Assort[AssortDate])=1), because I will count SKUs that were in the assortment in January, and I wanted to count those that were in January and are still there.
Does anyone have any idea how to count it?I would like to get a table that will show by months the number of products that were on sale in January and are still sold in each month.
I would be grateful for your help
Faustina
Solved! Go to Solution.
Try creating a measure like
Still on sale =
VAR JanProducts =
CALCULATETABLE (
VALUES ( Assort[ProductId] ),
MONTH ( Assort[AssortDate] ) = 1
)
VAR CurrentMonth =
MONTH ( MAX ( 'Date'[Date] ) )
VAR CurrentProducts =
CALCULATETABLE (
VALUES ( Assort[ProductId] ),
MONTH ( Assort[AssortDate] ) = CurrentMonth
)
RETURN
COUNTROWS ( INTERSECT ( CurrentProducts, JanProducts ) )
Try creating a measure like
Still on sale =
VAR JanProducts =
CALCULATETABLE (
VALUES ( Assort[ProductId] ),
MONTH ( Assort[AssortDate] ) = 1
)
VAR CurrentMonth =
MONTH ( MAX ( 'Date'[Date] ) )
VAR CurrentProducts =
CALCULATETABLE (
VALUES ( Assort[ProductId] ),
MONTH ( Assort[AssortDate] ) = CurrentMonth
)
RETURN
COUNTROWS ( INTERSECT ( CurrentProducts, JanProducts ) )
Thank you so much for a help!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |