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 am trying to set a filter to only show data within a certain time, 5AM-9PM. I cannot seem to figure a way to do this, looks like I can only filter by day, month etc... Any help would be appreciated.
Solved! Go to Solution.
Hi @AshleyRenee
1. You need to create a one-column table (or a new column in the date table you have already) with times only. Have a look at this for more info on how the DateTime type works in DAX. For instance, if you need hours only (00:00, 01:00, 02:00,...) you can build it as follows (this is a calculated table😞
TimeTable = SELECTCOLUMNS ( VAR _HoursStep = DIVIDE ( 1, 24 ) RETURN GENERATESERIES ( 0, _HoursStep * 23, _HoursStep ), "Hour", [Value] )
Note the SELECTCOLUMNS is only to set the name of the column to "Hours". You can use the table here this new
2. Then you need a column with only time in your fact table. You can create a new calculated column by extracting the time only from your date column. Something like this:
TimeColumn = FactTable[DateColumn] - TRUNC(FactTable[DateColumn])
3. Finally, you have to create a relationship between the two newly created columns
Hi @AshleyRenee
1. You need to create a one-column table (or a new column in the date table you have already) with times only. Have a look at this for more info on how the DateTime type works in DAX. For instance, if you need hours only (00:00, 01:00, 02:00,...) you can build it as follows (this is a calculated table😞
TimeTable = SELECTCOLUMNS ( VAR _HoursStep = DIVIDE ( 1, 24 ) RETURN GENERATESERIES ( 0, _HoursStep * 23, _HoursStep ), "Hour", [Value] )
Note the SELECTCOLUMNS is only to set the name of the column to "Hours". You can use the table here this new
2. Then you need a column with only time in your fact table. You can create a new calculated column by extracting the time only from your date column. Something like this:
TimeColumn = FactTable[DateColumn] - TRUNC(FactTable[DateColumn])
3. Finally, you have to create a relationship between the two newly created columns
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |