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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.