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.
I'm sure this is a common problem, but I've searched in vain for several hours. I have a calendar table and a transaction table. Each transaction has a calculated datetime for the start of the hour (ie. 3/4/2017 03:00:00) and this is related to a calendar table containing a datetime calculation for each of the 24hours in each day. I created an inactive relationship (Actual On Hour) tying the two tables together and used a measure to count the related records:
Actual Flights Per Hour = Calculate(COUNTROWS('Flights'),USERELATIONSHIP(Flights[Actual On Hour],'Calendar'[DateTime]))
This works fine:
but the problem is that I'm only getting records when there are matches. What I would like to see is every hour of every day, with zero's for the records where there are no relationships. Also, is there a way to do this without creating a relationship? I have four different dates and would prefer to not have to build inactive relationships for each.
Thanks so much,
bpopp
Solved! Go to Solution.
Hi @bpopp,
You can enable the option "Show items with no data" for the date column that is added to Matrix row.
Also, make a little adjustment to your original formula:
Actual Flights Per Hour = CALCULATE ( COUNTROWS ( 'Flights' ), USERELATIONSHIP ( Flights[Actual On Hour], 'Calendar'[DateTime] ) ) + 0
Best regards,
Yuliana Gu
Hi @bpopp,
What I would like to see is every hour of every day, with zero's for the records where there are no relationships.
What do you mean "with zero's for the records"? How are these records look like? Please provide sample data of 'Flights' table to better describe your scenario.
How to Get Your Question Answered Quickly
Regards,
Yuliana Gu
In the example above, there were no matches for 8/13 2:00, so it just skipped it and went to 8/13 3:00. What I want is for it to include 8/13 2:00 with the count for that hour set to zero.
Hi @bpopp,
You can enable the option "Show items with no data" for the date column that is added to Matrix row.
Also, make a little adjustment to your original formula:
Actual Flights Per Hour = CALCULATE ( COUNTROWS ( 'Flights' ), USERELATIONSHIP ( Flights[Actual On Hour], 'Calendar'[DateTime] ) ) + 0
Best regards,
Yuliana Gu
I must have seen that a million times and just didn't notice it. Thanks for the help.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |