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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ADSL
Post Prodigy
Post Prodigy

Find Product ID Active

Hello Community Team,

 

I have created and applied this measure to find the product ID active. With this measure, we will see the month that we stand/choose.

 

Product ID Active = CALCULATE(DISTINCTCOUNT('Sales Order'[Product ID]), 'Sales Order'[InvoiceType] = "F2", 'Sales Order'[Order Type] = "SALE")
 
Any suggestion/advise if we want to see and compare the previous month? Example: we choose the month "Aug" and compare with "Jul"
 
Thanks and Regards,
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ADSL ,

I create a table as you mentioned.

vyilongmsft_0-1724899828993.png

Then I create a new table.

DateTable = CALENDAR(MIN('Sales Order'[Order Date]), MAX('Sales Order'[Order Date]))

vyilongmsft_1-1724899970059.png

Next I create a measure and get what you want.

Measure = 
VAR _Previous =
    CALCULATE (
        DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
        'Sales Order'[InvoiceType] = "F2",
        'Sales Order'[Order Type] = "SALE",
        MONTH ( 'Sales Order'[Order Date] )
            = MONTH ( TODAY () ) - 1,
        YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
    )
VAR _Current =
    CALCULATE (
        DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
        'Sales Order'[InvoiceType] = "F2",
        'Sales Order'[Order Type] = "SALE",
        MONTH ( 'Sales Order'[Order Date] ) = MONTH ( TODAY () ),
        YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
    )
RETURN
    DIVIDE ( _Current - _Previous, _Previous, 0 )

vyilongmsft_2-1724900217691.png

 

 

 

Best Regards

Yilong Zhou

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

2 REPLIES 2
Anonymous
Not applicable

Hi @ADSL ,

I create a table as you mentioned.

vyilongmsft_0-1724899828993.png

Then I create a new table.

DateTable = CALENDAR(MIN('Sales Order'[Order Date]), MAX('Sales Order'[Order Date]))

vyilongmsft_1-1724899970059.png

Next I create a measure and get what you want.

Measure = 
VAR _Previous =
    CALCULATE (
        DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
        'Sales Order'[InvoiceType] = "F2",
        'Sales Order'[Order Type] = "SALE",
        MONTH ( 'Sales Order'[Order Date] )
            = MONTH ( TODAY () ) - 1,
        YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
    )
VAR _Current =
    CALCULATE (
        DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
        'Sales Order'[InvoiceType] = "F2",
        'Sales Order'[Order Type] = "SALE",
        MONTH ( 'Sales Order'[Order Date] ) = MONTH ( TODAY () ),
        YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
    )
RETURN
    DIVIDE ( _Current - _Previous, _Previous, 0 )

vyilongmsft_2-1724900217691.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

NaveenGandhi
Super User
Super User

Hi @ADSL 

This video should give you an idea.

https://www.youtube.com/watch?v=tu3i_BddKgc

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.