Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
Looking for a solution to my issue currently I am trying to have a duplicate count to display when a room is occupied within a duration of time
Example I want rooms that are the same that have the same room on the same day within the same time range to be counted as a duplicate not just when its start and end time are the same.
Thanks in advance for any help n this subject
bump.
@Anonymous
Try this calculated column
Duplicate Test = VAR CurrentStart = TableName[Date/Start Time Required] VAR CurrentEnd = TableName[Date/End Time Required] RETURN CALCULATE ( COUNTROWS ( TableName ), FILTER ( ALLEXCEPT ( TableName, TableName[Room (Option 1)], TableName[Date Rqeuired] ), OR ( TableName[Date/Start Time Required] > CurrentStart && TableName[Date/Start Time Required] < CurrentEnd, TableName[Date/End Time Required] > CurrentStart && TableName[Date/End Time Required] < CurrentEnd ) ) )
@Zubair_Muhammad
I'm not the most familiar with DAX but that returned this warning
A single value for column 'Date/Start-Time Required' in table 'Overlapping' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
@Anonymous
You tried adding it as a MEASURE....
The formula I wrote was for a calculated colum
There is an option to add Column as well...Please use that OPTION
@Zubair_Muhammad
Thank you for the help with this, I am very new to power BI, but seem to still have an issue with this calculable column it is complaining about a 'Token Eof Expected' on VAR CurrentStart
My code currently looks like this:
Duplicate Test = VAR CurrentStart = Overlapping[#"Date/Start-Time Required"] VAR CurrentEnd = Overlapping[#"Date/End-Time Required"] RETURN CALCULATE ( COUNTROWS ( Overlapping), FILTER ( ALLEXCEPT ( Overlapping, Overlapping[#"Room (Option 1)"], Overlapping[Date Required] ), OR ( Overlapping[#"Date/Start-Time Required"] > CurrentStart && Overlapping[#"Date/Start-Time Required"] < CurrentEnd, Overlapping[#"Date/End-Time Required"] > CurrentStart && Overlapping[#"Date/End-Time Required"] < CurrentEnd ) ) )
I can't share files in post but I have dropped it here...
https://www.dropbox.com/home?preview=Overlapping.pbix
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |