cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Wrong column total

Hi all,

I've stumbled upon a problem that seems to occur regularly. I've found numerous topics that provide information about it, but it might be a topic too many because I didn't manage to find the solution for my particular problem.

I have a couple of columns in my matrix:

• Aantal collectanten, measure: COUNTROWS(contact_role)
• Opbrengst per gebied, measure: sum('col_area_year'[c_amount_realized_revenue])
• Gemiddeld bedrag per collectant, measure:
CALCULATE(
if(
and([Opbrengst per gebied]=0,
[Aantal collectanten]>0),
55.5,
DIVIDE([Opbrengst per gebied],[Aantal collectanten])
)
)
• Forecast, measure:
CALCULATE(
if([Opbrengst per gebied]=0, 55.5*[Aantal collectanten],[Gemiddeld bedrag per collectant]*[Aantal collectanten])
)
I've also tried the simple way; forecast=[gemiddeld bedrag per collectant]*[aantal collectanten], but with the same result.

The column totals in the matrix don't add up. It only does, if the 'gemiddeld bedrag per collectant' is always 55.5 or never 55.5.

How can I solve this?
1 ACCEPTED SOLUTION
Frequent Visitor

And sometimes you find the solution just 10 minutes later

Nesting the calculate function in a SUMX did the trick.

Forecast =
sumx(col_area,
CALCULATE(
if([Opbrengst per gebied]=0, [Waarde van Gemiddelde bedrag per collectant]*[Aantal collectanten],[Gemiddeld bedrag per collectant]*[Aantal collectanten])
)
)
Frequent Visitor

And sometimes you find the solution just 10 minutes later

Nesting the calculate function in a SUMX did the trick.

Forecast =
sumx(col_area,
CALCULATE(
if([Opbrengst per gebied]=0, [Waarde van Gemiddelde bedrag per collectant]*[Aantal collectanten],[Gemiddeld bedrag per collectant]*[Aantal collectanten])
)
)

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors