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, I have below columns in two diffferent table and I would like to show count of no of machines which has 0 value for the latest date.
Table 1
Id | Machine |
1 | MachineA |
2 | MachineB |
3 | MachineC |
Table 2
Id | Value | Timestamp |
1 | 7 | 2021-09-09 |
1 | 4 | 2021-09-15 |
1 | 0 | 2021-09-21 |
2 | 6 | 2021-09-09 |
Here I want count as 1 as latest date in the timestamp is 2021-09-21 where one machine is having value as 0. How can I create a measure for this.
Solved! Go to Solution.
Here's a measure that can accomplish this:
MaxCount =
var l = maxx('Table 2','Table 2'[Timestamp])
var c = CALCULATE(DISTINCTCOUNT('Table 2'[Id]),ALLSELECTED('Table 2'),'Table 2'[Timestamp]=l,'Table 2'[Value]=0)
return c
Hi,
You may download my PBI file from here.
Hope this helps.
Here's a measure that can accomplish this:
MaxCount =
var l = maxx('Table 2','Table 2'[Timestamp])
var c = CALCULATE(DISTINCTCOUNT('Table 2'[Id]),ALLSELECTED('Table 2'),'Table 2'[Timestamp]=l,'Table 2'[Value]=0)
return c
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 | |
104 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |