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
IamTDR
Responsive Resident
Responsive Resident

Need Help Summing a Total

Screenshot.png
Hi

I am trying to the PIU column to sum to 450 instead of 204.  Is this possible?  I have 23 distinct ProductIDs and two distint ProgCodes that will always be 200/250.  Not sure how to proceed.
THanks in advance.

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

@IamTDR This is a bit different than the Test_Data 🙂 Try this measure:

PIU 2 =
VAR _t =
    SUMMARIZE (
        Test_Data,
        Test_Data[AccountNumber],
        Test_Data[ProgramCode],
        "PIU"MIN ( [ProgramAdmissions] )
    )
VAR _d =
    SUMX ( _tVALUE ( [PIU] ) )
RETURN
    _d

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Not sure how to do that, plus I have only real data that I cannot share online.

DataZoe
Microsoft Employee
Microsoft Employee

@IamTDR You could try this measure:

 

PIU =
VAR _min =
    MIN ( Test_Data[PIU] )
VAR _max =
    MAX ( Test_Data[PIU] )
VAR _same = _min = _max
RETURN
    IF ( _same_min_min + _max )

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

IamTDR
Responsive Resident
Responsive Resident

PIU =
VAR _min =
MIN ( Test_Data[ProgramAdmissions] )
VAR _max =
MAX ( Test_Data[ProgramAdmissions] )
VAR _same = _min = _max
RETURN
IF ( _same, _min, _min + _max )

This worked on my small sample data, but when I tried to use in my BI report I receive a "The end of the input was reached" message.
IamTDR
Responsive Resident
Responsive Resident

Screenshot_2.png

First thanks for the feedback.
I am attempting to sum my PIU number but this number should be summed by AcctNumber and ProgramCode.
In the example picture, the sum should be 711.
Should I create a concatenate of accountnumber and programcode and use that field to sum my PIU?

DataZoe
Microsoft Employee
Microsoft Employee

@IamTDR This is a bit different than the Test_Data 🙂 Try this measure:

PIU 2 =
VAR _t =
    SUMMARIZE (
        Test_Data,
        Test_Data[AccountNumber],
        Test_Data[ProgramCode],
        "PIU"MIN ( [ProgramAdmissions] )
    )
VAR _d =
    SUMX ( _tVALUE ( [PIU] ) )
RETURN
    _d

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

IamTDR
Responsive Resident
Responsive Resident

Thank you!  The lastest measure, PIU2 worked!

 

Thanks again!Screenshot3.png

DataZoe
Microsoft Employee
Microsoft Employee

@IamTDR Glad it worked! 🙂

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

DataZoe
Microsoft Employee
Microsoft Employee

@IamTDR hmm, not really sure why that error would show as it's usually syntax error. Maybe there are blanks in the bigger set?

PIU =
VAR _min =
    MIN ( Test_Data[ProgramAdmissions] )
VAR _max =
    MAX ( Test_Data[ProgramAdmissions] )
VAR _same =
    IF ( ISBLANK ( _min )FALSE ()_min = _max )
RETURN
    IF ( _same_min_min + _max )

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

IamTDR
Responsive Resident
Responsive Resident

Sorry, I still had the same error.  My dataset is large with many accounts and program codes.  Maybe thats my issue?

amitchandak
Super User
Super User

@IamTDR , Not very clear try a new measure like

 

sumx(values('test_date'[project_id]),[PIU])

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

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.