Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Mandi-Holt
Frequent Visitor

Combine values from different rows to allow duplicates to be removed

I am fairly new to using Power BI and Power Query and have a table that has been created from doing a left outer join on a WeatherReading table and a CustomWeather table.

The new table has multiple rows with the same VslReadingId where there were multiple CustomWeather.Ids.

MandiHolt_0-1646132723722.png

I need to have the CustomWeather.Key values as separate columns with the values for each in the row so the table appears as:

OperationName

Date

Visibility

WindGustRecorded AtCalculatedValue

Earthquake

TRV

Temp

Loadout

27/04/2021 00:00

50000

24.74

1

1

 

 

I have created custom columns for each value in the CustomWeather.Key (Earthquake, TRV and Temp) using the following formula for each column (there won't be many custom weather keys created so it is not a major issue to create the new columns individually each time one is added):

    • Earthquake = IF [CustomWeather.Key] = “Earthquake” then [CustomWeather.Value] else null

This has then given me the following :

MandiHolt_2-1646133929069.png

At this point I've become stuck through my lack of knowledge. I don't know how to have the individual CustomWeather.Value against each VlsReadingId so I can then remove the duplicate VslReadinId's and therefore pull a report grid together displaying all the weather readings along one row.

ie include all the Earthquake, TRV and Temp values in the correct columns and on each row where the VslReadingId is the same.

 

Any help will be gratefully recieved. 

Mandi

 

 

1 ACCEPTED SOLUTION
Mandi-Holt
Frequent Visitor

Just to update that this issue has been solved externally to this group. In case anyone else is looking to do the same then here's a couple of solutions.

Add a calculated table:

Table1 = 

SUMMARIZE (

AllWeatherReadings,

AllWeatherReadings[VslReadingId],

“Earthquake”, MAX ( AllWeatherReadings[Earthquake] ),

“TRV”, MAX ( AllWeatherReadings[TRV] ),

“Temp”, MAX ( AllWeatherReadings[Temp] )

 

The alternative is in Power Query to use the Group By, select advanced and add grouping by the VslReadingId column, name the columns the same, set them to Max and ok.

 

Thank you.

View solution in original post

1 REPLY 1
Mandi-Holt
Frequent Visitor

Just to update that this issue has been solved externally to this group. In case anyone else is looking to do the same then here's a couple of solutions.

Add a calculated table:

Table1 = 

SUMMARIZE (

AllWeatherReadings,

AllWeatherReadings[VslReadingId],

“Earthquake”, MAX ( AllWeatherReadings[Earthquake] ),

“TRV”, MAX ( AllWeatherReadings[TRV] ),

“Temp”, MAX ( AllWeatherReadings[Temp] )

 

The alternative is in Power Query to use the Group By, select advanced and add grouping by the VslReadingId column, name the columns the same, set them to Max and ok.

 

Thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors