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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ricod
Regular Visitor

variation in and out

Hello

 

i've got an anwser previously but it not solved as i believed. 

 

i've a folder with xslx files containing cat and dog names. i want from 1st september 2024 calculate the variation of placements. i've tried many thinks with date table or not but i'm not able to do it specially when i filter with type (dog or cat)

 

can you help ?

 

xlsx file(s)

typearrivaldeparture
dog01/01/202502/01/2025
cat01/01/202501/02/2025
dog02/01/202502/02/2025
dog02/01/202502/02/2025
dog04/01/2025 
dog04/01/2025 
dog04/01/2025 
dog04/01/2025 
dog03/01/202403/02/2025
dog03/01/202403/02/2025

 

output expected (with possibility to filter on type cat, dog, ... ) :

dateINOUTvariation
Jan. 2025211
feb. 2025230
mar. 202502-2
apr. 2025402
4 REPLIES 4
speedramps
Super User
Super User

Your question is too vague and confussing.

Your example input does not have any dog or cat "names".

hi,

 

it's in the xlsx files, but i should filter by using a segment on pbi

 

typeinout
dog04/12/2023 
dog10/05/2023 
dog15/11/2021 
dog10/09/2018 
dog16/06/2021 
dog15/04/2024 
dog13/11/2023 
dog19/06/2023 
dog19/03/2020 
dog12/11/202406/12/2024
dog01/07/201931/12/2024
dog15/11/2021 
dog05/05/2022 
dog30/05/2023 
cat17/10/2024 
cat10/10/2022 
cat01/01/2021 
cat12/06/2023 
cat14/09/2022 
cat04/12/2022 
cat20/05/202004/11/2024
cat15/03/2022 
cat01/02/2019 
cat01/10/201731/12/2024
cat19/04/2022 
cat17/02/2020 
cat27/05/202426/09/2024
cat01/01/202315/11/2024
cat02/10/2017 
cat04/09/2023 
cat17/10/202207/11/2024
cat06/01/2025 
cat10/06/2024 
cat16/04/2024 
cat01/10/2020 
cat19/10/2022 
cat01/09/2016 
cat01/01/2016 
cat31/03/2016 
cat07/11/2024 
cat16/04/2020 
cat01/07/201131/12/2024
cat27/05/202408/10/2024
cat01/07/2019 
cat02/01/2018 
johnt75
Super User
Super User

Create a date table and mark it as a date table. Create an active relationship from the date table date column to arrival, and create an inactive relationship to departure.

You can then create 3 measures like

Number in = COUNTROWS( 'Table' )

Number out =
CALCULATE (
    COUNTROWS ( 'Table' ),
    USERELATIONSHIP ( 'Date'[Date], 'Table'[Departure] )
)

Variance = [Number in] - [Number out]

on line S41 i should have -2

S42 : -1

S45 : -2

...

 

ricod_1-1738686025557.png

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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