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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Silvermountain
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.
     
     

    Silvermountain_0-1669823520528.png

     

    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
Silvermountain
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])
    )
)

View solution in original post

1 REPLY 1
Silvermountain
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])
    )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors