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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Antonio_Gomez
Resolver I
Resolver I

Error adding (Sum) Columns or Rows

Hello Everyone,

 

I have this issue:

 

If I use this formula the total of the rows is OK, but the total of the columns is wrong:

 

PerDifAtendPersCorr =
VAR _table = SUMMARIZE(Proyectos,Proyectos[Nombre], "__value", [PerDifAtendPers])
RETURN
IF(
HASONEVALUE(Proyectos,Proyectos[Nombre]),
[PerDifAtendPers],
SUMX(_table, [__value])
)

 

**************

PerDifAtendPers = CALCULATE(
DISTINCTCOUNT(AccionesIPI[IDSolicitante]),
FILTER(
AccionesIPI,
OR(
AccionesIPI[Medio] = "Presencial",
AccionesIPI[Medio] = BLANK()
)
)
)

 

 

Antonio_Gomez_0-1691162699499.png

 

 

And, if I use this formula, it is the other way around. The total of the columns is OK, but the total of the rows is wrong:

 

PerDifAtendPersCorr =
VAR _table = SUMMARIZE('Calendario Base','Calendario Base'[Trim], "__value", [PerDifAtendPers])
RETURN
IF(
HASONEVALUE('Calendario Base','Calendario Base'[Trim]),
[PerDifAtendPers],
SUMX(_table, [__value])
)

 

Antonio_Gomez_1-1691163019678.png

 

 

 

An image of one row expanded, just in case

 

Antonio_Gomez_2-1691163548248.png

 

 

 

 

What is the formula for both columns and rows to add up well?

 

Thanks in advance!

 

 

.

 

 

 

 

 

1 ACCEPTED SOLUTION

@foodd 

 

I used this mesarure and the problem was solved

 

PerDifAtendPersCorr = SUMX(Proyectos,[PerDifAtendPers] )

 

 

Where:

 

PerDifAtendPers = CALCULATE(
DISTINCTCOUNT(AccionesIPI[IDSolicitante]),
FILTER(
AccionesIPI,
OR(
AccionesIPI[Medio] = "Presencial",
AccionesIPI[Medio] = BLANK()
)
)
)

 

 

View solution in original post

5 REPLIES 5
foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Hi @foodd 

 

Thanks for your interest in helping me. But, I'm not a super user nor Microsoft employee, I can't attached files 😞

The notion covered in  How to provide sample data in the Power BI Forum (in the last thread reply) suggests storing your files in one of any of the Cloud Storage providers such as OneDrive or Google Drive, setting the sharing to anonymous on the files, and pasting the sharing link into the post.

@foodd 

 

I could upload the file to Google Drive, but it has a lot of sensitive/personal data which is connected to the DB. So, I don't know how to give you the file taking the sensitive data out.

 

There is another way? Maybe with captures or explaining you the relationship, etc.

 

Antonio_Gomez_0-1691498517892.png

 

@foodd 

 

I used this mesarure and the problem was solved

 

PerDifAtendPersCorr = SUMX(Proyectos,[PerDifAtendPers] )

 

 

Where:

 

PerDifAtendPers = CALCULATE(
DISTINCTCOUNT(AccionesIPI[IDSolicitante]),
FILTER(
AccionesIPI,
OR(
AccionesIPI[Medio] = "Presencial",
AccionesIPI[Medio] = BLANK()
)
)
)

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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