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.
Hello,
I need some help to create/add a column with the value that has the max no of appearances in a day.
I have a weather station and i need to put in a table the max wind direction, the table looks like:
ReadTime | Anemometer | WindDirection |
3/6/2019 23:19 | 4.8 | NE |
3/6/2019 23:25 | 2.4 | SSE |
3/6/2019 23:31 | 1.6 | SE |
3/6/2019 23:37 | 2.4 | SSE |
3/6/2019 23:42 | 2.4 | N |
3/6/2019 23:48 | 3.2 | E |
3/6/2019 23:53 | 3.2 | NE |
3/6/2019 23:59 | 1.6 | SW |
3/7/2019 0:05 | 2.4 | NE |
3/7/2019 0:11 | 0.8 | N |
3/7/2019 0:17 | 0 | NoWind |
3/7/2019 0:22 | 0 | NoWind |
3/7/2019 0:28 | 3.2 | SE |
3/7/2019 0:33 | 3.2 | SE |
3/7/2019 0:39 | 2.4 | SE |
3/7/2019 0:45 | 1.6 | NE |
3/7/2019 0:51 | 8 | E |
I need a formula to make the table look like:
ReadTime | Anemometer | WindDirection | Max WindDirection |
3/6/2019 23:19 | 4.8 | NE | NE, SSE |
3/6/2019 23:25 | 2.4 | SSE | NE, SSE |
3/6/2019 23:31 | 1.6 | SE | NE, SSE |
3/6/2019 23:37 | 2.4 | SSE | NE, SSE |
3/6/2019 23:42 | 2.4 | N | NE, SSE |
3/6/2019 23:48 | 3.2 | E | NE, SSE |
3/6/2019 23:53 | 3.2 | NE | NE, SSE |
3/6/2019 23:59 | 1.6 | SW | NE, SSE |
3/7/2019 0:05 | 2.4 | NE | SE |
3/7/2019 0:11 | 0.8 | N | SE |
3/7/2019 0:17 | 0 | NoWind | SE |
3/7/2019 0:22 | 0 | NoWind | SE |
3/7/2019 0:28 | 3.2 | SE | SE |
3/7/2019 0:33 | 3.2 | SE | SE |
3/7/2019 0:39 | 2.4 | SE | SE |
3/7/2019 0:45 | 1.6 | NE | SE |
3/7/2019 0:51 | 8 | E | SE |
On 6 March 2019 i had the winddirection 2 times from NE and 2 time from SSE, so i need the both and on 7 March 2019 i had 3 times from SE.
The NoWind direction should not be considered.
Thank you.
Solved! Go to Solution.
Try this Calc column
Calc Column = CONCATENATEX ( TOPN ( 1, SUMMARIZE ( FILTER ( Table1, [ReadTime].[Date] = EARLIER ( Table1[ReadTime].[Date] ) ), [ReadTime].[Date], Table1[WindDirection], "MyCount", COUNTROWS ( Table1 ) ), [MyCount], DESC ), [WindDirection], ", " )
Try this Calc column
Calc Column = CONCATENATEX ( TOPN ( 1, SUMMARIZE ( FILTER ( Table1, [ReadTime].[Date] = EARLIER ( Table1[ReadTime].[Date] ) ), [ReadTime].[Date], Table1[WindDirection], "MyCount", COUNTROWS ( Table1 ) ), [MyCount], DESC ), [WindDirection], ", " )
Hello@Zubair_Muhammad ,
The only missing thing was that the sintax took into consideration also the NoWind values.
So i added the "and" sintax in the filter command like this:
FILTER ( Table1, and ([ReadTime].[Date] = EARLIER ( Table1[ReadTime].[Date] ), Table1[WindDirection] <> "NoWind" )),
Now it is exactlly what i needed.
Thank you very much.
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 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |