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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GeekAlfPro
Resolver II
Resolver II

measure rental inventory

Hello,

 

i've a table in which i have karting with a start date rental and end date rental.

 

GeekAlfPro_0-1642521080702.png

 

i'd like to measure the "stock" of rented karts or the available materials which is the opposite

For a given day, if it's between the two dates, the kart is rented, otherwise, not.

i tried a running total, but it sums the data

 

 

m_Total cumulé de Nombre de Lien Facturation::N° Contrat Comp dans Date = 
CALCULATE(
	COUNTA('Contrats Location'[Lien Facturation::N° Contrat Comp]),
	FILTER(
		ALLSELECTED('Date'[Date]),
		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
	)
)

 

 

But i don't want a cumulative total, because when the rental is finished, then my kart is available.

 

My question is 

Can measure that with dax

Or do i have to create a table with power Query that sums by day and the rented karts to display in a chart ?

 

thanks

 

i hope i'm clear.

 

 

1 ACCEPTED SOLUTION
GeekAlfPro
Resolver II
Resolver II

Hello @amitchandak 

 

Perfect, i manage  to get the figure i was looking for thanks to the following formula !

Current Employees = CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))

 

Have a good day !

View solution in original post

3 REPLIES 3
GeekAlfPro
Resolver II
Resolver II

Hello @amitchandak 

 

Perfect, i manage  to get the figure i was looking for thanks to the following formula !

Current Employees = CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))

 

Have a good day !

GeekAlfPro
Resolver II
Resolver II

Hello @amitchandak 

 

thanks for the link, i will study them carefully !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.