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.
Hi everyone. I have a table contains all transaction that happened last 7 days in factory. It has a column contains "Date Time" type of data that accurate to seconds. How can I create a visual that only display those transactions which happened in last 20 hours?
Solved! Go to Solution.
Hi @Anonymous ,
Sample for your reference.
1. Create a measure as below.
Measure = VAR _now = NOW () VAR _diff = DATEDIFF ( MAX ( 'Table1'[date] ), [now], HOUR ) RETURN IF ( _diff <= 20 && _diff >= 0, 1, 0 )
2. Make the visual filtered by the measure.
Pbix as attached.
Regards,
Frank
Hi @Anonymous ,
Sample for your reference.
1. Create a measure as below.
Measure = VAR _now = NOW () VAR _diff = DATEDIFF ( MAX ( 'Table1'[date] ), [now], HOUR ) RETURN IF ( _diff <= 20 && _diff >= 0, 1, 0 )
2. Make the visual filtered by the measure.
Pbix as attached.
Regards,
Frank
MyMeasure = CALCULATE( [SomeAggregate], FILTER(MyTable, [MyDateTime] >= MAX(MyTable[MyDateTime]) - (20/24)) )
MyMeasure = // ALL is used here to remove any filters from MAX(DateTime) CALCULATE( [SomeAggregate], FILTER(MyTable, [MyDateTime] >= CALCULATE( MAX(MyTable[MyDateTime]) - (20/24)), ALL(MyTable) ) )
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |