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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
richardwg
Frequent Visitor

Help with Grouping Values

Hi Everyone, 

I need help trying to figure out a group by function or some other function that will allow me to sum the total HashrateAVG for a specefic 'LCDName' in the data table below, where 'ASC' can be repeated multiple times for LCD name and I only need it summed once. For example in the case below for 'LCDName' 2324 it should return 72.015 (11.86+25.28+34.87).

I've tried this and keep getting a error.

HR by server =
 VAR HR_Server =
    GROUPBY('WM HB Data','WM HB Data'[Date],'WM HB Data'[LCD Name],'WM HB Data'[Asc],
        "HashrateAvg", MAX(CURRENTGROUP(),MAX('WM HB Data'[HashrateAvg])))

RETURN
MAX(HR_Server, MAX([HashrateAvg]))

 

richardwg_0-1706208034363.png

richardwg_1-1706208526061.png

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@richardwg 

1. you can remove duplicates in PQ, that will be easier for you to calculate

2. or you can try this

Table 2 = 
var tbl=ADDCOLUMNS('Table',"average",'Table'[Avg]/CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[date]=EARLIER('Table'[date])&&'Table'[LCD NAME]=EARLIER('Table'[LCD NAME])&&'Table'[Avg]=EARLIER('Table'[Avg]))))
return SUMMARIZE(tbl,[date],[LCD NAME],"output",sumx(FILTER(tbl,'Table'[date]=EARLIER('Table'[date])&&'Table'[LCD NAME]=EARLIER('Table'[LCD NAME])),[average]))

 

11.png

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@richardwg 

1. you can remove duplicates in PQ, that will be easier for you to calculate

2. or you can try this

Table 2 = 
var tbl=ADDCOLUMNS('Table',"average",'Table'[Avg]/CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[date]=EARLIER('Table'[date])&&'Table'[LCD NAME]=EARLIER('Table'[LCD NAME])&&'Table'[Avg]=EARLIER('Table'[Avg]))))
return SUMMARIZE(tbl,[date],[LCD NAME],"output",sumx(FILTER(tbl,'Table'[date]=EARLIER('Table'[date])&&'Table'[LCD NAME]=EARLIER('Table'[LCD NAME])),[average]))

 

11.png

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.