Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I have a lot of IoT devices. which uploaded voltage value with sample rate 1 minute into cloud.
raw table will be like following:
IoT ID | Voltage (V) | time |
1 | 2.2 | 5:07 |
2 | 5 | 5:07 |
3 | 2.2 | 5:07 |
4 | 1.6 | 5:07 |
1 | 3.2 | 5:08 |
2 | 7 | 5:08 |
3 | 1.8 | 5:08 |
4 | 1 | 5:08 |
1 | 5 | 5:09 |
2 | 2 | 5:09 |
3 | 4 | 5:09 |
4 | 2.1 | 5:09 |
1 | 2 | 5:10 |
2 | 2 | 5:10 |
3 | 1.2 | 5:10 |
4 | 1.2 | 5:10 |
then a summerized Table will be like following:
I create a measure to get duration with voltage<3V (min) accumulated.
then If I put table visualization with this measure combine with IoT ID
then it will like following in Power BI
IoT ID | duration Voltage<3V (min) |
1 | 2 |
2 | 2 |
3 | 3 |
4 | 4 |
I would like to write Dax code to get two value in the table above:
1. count number of row with duration >3 min: 2 in this case
2. max. value of duration: 4 in this case
Thanks in advance
Best regards
Renhao
Hi @reynold522
1.max = MAX('Table'[vtg])
2. Count rows = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[vtg]>=1))
Output:
Best Regards,
Shreya Mukkawar
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi Shreyamukkawar,
Thank you for the fastest speed to answer my question.
I may not explain my question clearly.
The table is a visualizations table from power BI. it is not a real table in Power BI Field.
Visualizations table is a result, accumlulated duration (hour) is asgined for each IoT ID and show as table in Power BI
The max function wont work as there is no table, no column.
However, Still thanks
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |