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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Cyprix
Frequent Visitor

Data Relationship help

Hello Everyone,

 

New user to powerbi here. I am trying to create a report that when given a list of rooms and a date period, I can show how many times each room was logged as well as the day of the week. My goal is to have my user provide a list of rooms and the date range of the week or 2 week period, and have the report show each room and how many times each room was completed as well as the day of the week.

 

My Data looks like this 

 

HospitalB

 SessionIDUploaddateSessionTypeRoomTechnicianStartTimeEndTimeStopReasonRuntimeDeviceVersionAccount 
 8477191/1/17 12:05 AMSporeOR1dossing12/31/16 9:13 PM12/31/16 10:05 PMCycle Complete31333041.9.2AHospitalA 
 8477201/1/17 12:07 AMBacteriaOR1dee12/31/16 10:33 PM12/31/16 11:07 PMCycle Complete1985511.9.2A 
HospitalB
 
 8477211/1/17 12:08 AMSporeOR1manuel12/31/16 8:36 PM12/31/16 9:08 PMCycle Complete19163041.9.2A
HospitalA
 
 8477231/1/17 12:19 AMBacteriaOR3cindy12/31/16 11:04 PM12/31/16 11:19 PMCycle Complete9043861.9.2AHospitalA 
              
1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Cyprix,

 

If I understand you correctly, you should be able to firstly use the formula below to add a calculate column to get the day of the week.

Day of Week = FORMAT(HospitalB[EndTime],"dddd")

c1.PNG

 

Then use the formula below to create a new measure to calculate how many times each room was completed.

Count Of Completed = CALCULATE(COUNTA(HospitalB[StopReason]),HospitalB[StopReason]="Cycle Complete")

m1.PNG

 

And then you can show the Room column with the Day of Week column and the measure [Count Of Completed] on the Table visual. Smiley Happy

r1.PNG

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Cyprix,

 

If I understand you correctly, you should be able to firstly use the formula below to add a calculate column to get the day of the week.

Day of Week = FORMAT(HospitalB[EndTime],"dddd")

c1.PNG

 

Then use the formula below to create a new measure to calculate how many times each room was completed.

Count Of Completed = CALCULATE(COUNTA(HospitalB[StopReason]),HospitalB[StopReason]="Cycle Complete")

m1.PNG

 

And then you can show the Room column with the Day of Week column and the measure [Count Of Completed] on the Table visual. Smiley Happy

r1.PNG

 

Regards

Yes thank you that helped alot but now I am trying to have my tables show blanks for days that no rooms were not logged.Test.PNG

 The table on the left shows data where no rooms were logged on Monday, and I feel the data can be easily misunderstood if it does not show the blank Monday column on the table. The goal is to have table 1 one look like table 2 wether or not a day was skipped. 

 

Thank you in advance,

 

Alex

Hi @Cyprix,

 

A few more steps are needed to achieve that. Smiley Happy

 

1. Use the formula below to create a new table which contains a column of Day of Week.

WeekTable = 
DATATABLE (
    "Week Day", STRING,
    "Index", INTEGER,
    {
        { "Sunday", 1 },
        { "Monday", 2 },
        { "Tuesday", 3 },
        { "Wednesday", 4 },
        { "Thursday", 5 },
        { "Friday", 6 },
        { "Saturday", 7 }
    }
)

t1.PNG

 

2. Sort Day of Week column by Index column.

 

sort2.PNG

 

3. Create a relationship between the WeekTable and your original table with the Day of Week column.

relation1.PNG

 

4. Then show the Day of Week column from the WeekTable(instead of the original table) on the Matrix, and right click on the column and select "Show items with no data".

r1.PNG

 

 

Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors