Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I'm looking to get the count of total dogs who were actively in a kennel each month in 2024. Using the table, what measure would give me the figures below, please? Where to connect the dates is giving me the most problems. I have made a calendarauto calendar, but I can't connect the Calendarauto[date] to the Table[Start_Date] AND Table[End_Date] as it gives me an ambiguous path error. How do I do this, please? Any help is greatly appreciated.
January 9
February 9
March 8
April 8
May 7
June 7
July 5
August 5
September 3
October 3
November 3
December 3
Dog | Start_Date | End_Date | Support_Status |
Max | 01/01/2024 | 20/05/2024 | Closed |
Molly | 01/01/2024 | Open | |
Alba | 01/01/2024 | 20/07/2024 | Closed |
Chester | 01/01/2024 | 20/08/2024 | Closed |
Birdie | 01/01/2024 | Open | |
Alf | 01/01/2024 | 20/06/2024 | Closed |
Biffy | 01/01/2024 | Open | |
Bob | 01/01/2024 | 20/02/2024 | Closed |
Tess | 01/01/2024 | 20/04/2024 | Closed |
Thanks
Solved! Go to Solution.
@RichOB You already have a Calendarauto table, but ensure it covers the year 2024.
Calendar = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))
You cannot directly connect both Start_Date and End_Date to the Calendar table due to the ambiguous path error. Instead, you can use measures to calculate the active dogs.
Create Measures: Use DAX to create measures that count the number of active dogs for each month.
ActiveDogs =
VAR CurrentMonthStart = MIN(Calendar[Date])
VAR CurrentMonthEnd = MAX(Calendar[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_Date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_Date]), Table[End_Date] >= CurrentMonthStart)
)
Use a matrix or table visual to display the count of active dogs by month.
Proud to be a Super User! |
|
pls see if this is what you want
Proud to be a Super User!
@RichOB Hey,
First create a caleder table using New Table -> use dax
Hopefully this will solve your issue.
Thanks
Harish M
Did I answer your question? Mark my post as a solution!
Hi @RichOB
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @RichOB
I wanted to check if you had the opportunity to review the information provided by @HarishKM , @bhanu_gautam and @ryan_mayu . Please feel free to contact us if you have any further questions. If their response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
@RichOB Hey,
First create a caleder table using New Table -> use dax
Hopefully this will solve your issue.
Thanks
Harish M
Did I answer your question? Mark my post as a solution!
Hi @RichOB
Thank you for reaching out microsoft fabric community forum.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
pls see if this is what you want
Proud to be a Super User!
@RichOB You already have a Calendarauto table, but ensure it covers the year 2024.
Calendar = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))
You cannot directly connect both Start_Date and End_Date to the Calendar table due to the ambiguous path error. Instead, you can use measures to calculate the active dogs.
Create Measures: Use DAX to create measures that count the number of active dogs for each month.
ActiveDogs =
VAR CurrentMonthStart = MIN(Calendar[Date])
VAR CurrentMonthEnd = MAX(Calendar[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_Date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_Date]), Table[End_Date] >= CurrentMonthStart)
)
Use a matrix or table visual to display the count of active dogs by month.
Proud to be a Super User! |
|
User | Count |
---|---|
81 | |
75 | |
70 | |
42 | |
36 |
User | Count |
---|---|
114 | |
56 | |
52 | |
43 | |
42 |