mgirvin
Well-known Member
- Joined
- Dec 15, 2005
- Messages
- 1,245
- Office Version
- 365
- Platform
- Windows
Dear Team,
My goal is to find a DAX Measure that will count the number of properties rented each month.
My Data Model consists of three tables. The tables are:
1) fRentalDates, with the field names: Transaction Number, Property Number, Rent Order Date, Actual Rent Date, Move Out Order Date, Actual Move Out Date
2) dProperties, with field names: Property Number, Address, Date Purchased, Date Sold, SQ FT
3) dDate, with field names: Date, Day, MonthNumber, MonthName, Month Year, Year
There is a One-To-Many relationship between dProperties[Property Number] and fRentalDates[Property Number]. And a second One-To-Many relationship between dDate[Date] and fRentalDates[Rent Order Date].
My first question is: I was not sure which date column in the fRentalDates I should create a relationship with. I chose the fRentalDates[Rent Order Date] column. If that is not a good column, maybe someone knows the correct column for the relationship?
For the DAX Measure that will count the number of properties rented each month, I dropped the Month Year field into the PivotTable Row Area, and then I tried these two Measures:
Number Rented 01 =
COUNTX (
dProperties,
CALCULATE (
COUNTROWS (
FILTER (
fRentalDates,
AND (
fRentalDates[Actual Rent Date] <= MIN ( dDate[Date] ),
fRentalDates[Actual Move Out Date] >= MAX ( dDate[Date] )
)
)
)
)
)
and then I tried:
=
COUNTX (
dProperties,
COUNTROWS (
FILTER (
fRentalDates,
AND (
fRentalDates[Actual Rent Date] <= MIN ( dDate[Date] ),
fRentalDates[Actual Move Out Date] >= MAX ( dDate[Date] )
)
)
)
)
Neither one gave me the correct answer.
Does anyone know how to make a DAX Formula that can accomplish the goal of counting the number of properties rented each month?
If you want to download the file I am using, here it is:
https://people.highline.edu/mgirvin/YouTubeExcelIsFun/BIDeskrtopRentalTest04.xlsx
BTW, I have accomplished all the formulas I need using Excel Spreadsheet formula. You can see these on the sheet "Tables". These can be check numbers for the correct result for the formula "Number Properties Rented". I just need to now figure how to do it in DAX.
Sincerely, Mike Girvin
My goal is to find a DAX Measure that will count the number of properties rented each month.
My Data Model consists of three tables. The tables are:
1) fRentalDates, with the field names: Transaction Number, Property Number, Rent Order Date, Actual Rent Date, Move Out Order Date, Actual Move Out Date
2) dProperties, with field names: Property Number, Address, Date Purchased, Date Sold, SQ FT
3) dDate, with field names: Date, Day, MonthNumber, MonthName, Month Year, Year
There is a One-To-Many relationship between dProperties[Property Number] and fRentalDates[Property Number]. And a second One-To-Many relationship between dDate[Date] and fRentalDates[Rent Order Date].
My first question is: I was not sure which date column in the fRentalDates I should create a relationship with. I chose the fRentalDates[Rent Order Date] column. If that is not a good column, maybe someone knows the correct column for the relationship?
For the DAX Measure that will count the number of properties rented each month, I dropped the Month Year field into the PivotTable Row Area, and then I tried these two Measures:
Number Rented 01 =
COUNTX (
dProperties,
CALCULATE (
COUNTROWS (
FILTER (
fRentalDates,
AND (
fRentalDates[Actual Rent Date] <= MIN ( dDate[Date] ),
fRentalDates[Actual Move Out Date] >= MAX ( dDate[Date] )
)
)
)
)
)
and then I tried:
=
COUNTX (
dProperties,
COUNTROWS (
FILTER (
fRentalDates,
AND (
fRentalDates[Actual Rent Date] <= MIN ( dDate[Date] ),
fRentalDates[Actual Move Out Date] >= MAX ( dDate[Date] )
)
)
)
)
Neither one gave me the correct answer.
Does anyone know how to make a DAX Formula that can accomplish the goal of counting the number of properties rented each month?
If you want to download the file I am using, here it is:
https://people.highline.edu/mgirvin/YouTubeExcelIsFun/BIDeskrtopRentalTest04.xlsx
BTW, I have accomplished all the formulas I need using Excel Spreadsheet formula. You can see these on the sheet "Tables". These can be check numbers for the correct result for the formula "Number Properties Rented". I just need to now figure how to do it in DAX.
Sincerely, Mike Girvin
Last edited: