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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Luuky
Helper I
Helper I

How to create unique values for sum function?

Dear Reader,

 

Currently i am working on a dashboard with weather data. I am pretty new to PowerBI and working on improving my skills. 

The problem i am facing is:

FullSunHour needs to be seen as a unique value and once summed it needs to add to 6257,81 instead of 1794,16. 

7 seperate locations are shown but some share the same weather station (240 or 260). 

It now only sees it as 2 different values now because there are only 2 weather stations involved. 

I want it be referenced to the location name (name) which has 7 unique results in this table. 

Luuky_0-1660226069878.png

*Due to privacy I blurred the location name out a bit.

 

Additional information:

model:

Luuky_2-1660227110399.png

 

Formula for FullSunHour in power query editor:

= Table.AddColumn(#"Changed Type1", "FullSunHour", each ([#" Q"]*(1/360)))

 

Thanks in advance!

 

4 REPLIES 4
amitchandak
Super User
Super User

@Luuky , Try a measure like

 

Sumx(summarize(Table, Table[Name], Table[full Sun Hour]) ), [Full sun hour])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amitchandak,

 

When I implement it, this is result (named the measure SunHour):

Luuky_0-1660286645349.png

Does not seem to be working and the values are wrong now aswell.

 

 

Hi @Luuky ,

 

The formula @amitchandak  provided is correct, with just a slight error. Please try the following formula.

fullSunHour1=
SUMX (
    SUMMARIZE (
        'KNMI DATA',
        'ALL location'[WeatherStationKey],
        'Date'[Year],
        "full", [Full sun hour]
    ),
    [full]
)

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-chenwuz-msft @amitchandak ,

Thanks for your responses, I managed to complete the dashboard using measures. Some of the measures I had to combine with Sumx(), Calculate() and DistinctCount(). 

To fix the FullSunHour problem I did the following:

Measure: FullSun = SUMX('KNMI DATA','KNMI DATA'[    Q]*(1/360))

Followed by:

Measure: NewFullSun = SUMX('All locations', [FullSun])

That somehow made it sum the correct way.

Luuky_0-1660811703540.png

Thanks for your responses!

 

Greetings,

 

Luuk

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.