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
Vitor_sp_bo
Helper I
Helper I

Control logistics

Guys, good morning!

I need help to discover the recurrence of a product in my inventory, in my data sheet I have two columns (Date, Product) where 1 product can have several dates being 1 date per line, what I need to know is the percentage of products that are in my stock today since yesterday, ie 100 products I have in stock today, how much % is there since yesterday?

thank you in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Vitor_sp_bo , with help from date table

 

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

 

then

Present on both days = Present on both days = countx(Values(Table[Product]), not(isblank([Last Day])) && not(isblank([This Day])) )

 

Presnet today = countx(Values(Table[Product]),  not(isblank([This Day])) )

 

Then calculate the ratio

 

Idea from

https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Vitor_sp_bo , with help from date table

 

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

 

then

Present on both days = Present on both days = countx(Values(Table[Product]), not(isblank([Last Day])) && not(isblank([This Day])) )

 

Presnet today = countx(Values(Table[Product]),  not(isblank([This Day])) )

 

Then calculate the ratio

 

Idea from

https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.