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
Pikachu-Power
Post Prodigy
Post Prodigy

Divide Problem in a Table

Hello,

I have a strange problem by dividing numbers. May someone can help. I have the following table (changed the numbers for an example):

 

1.PNG

 

For every Quarter I want a different calculation that works with no problem:

 

Measure1 =
SUMX (
    Table,
    SWITCH (
        TRUE (),
        Table[Quarter] = 1, Table[Ist]-Table[Budget],
        Table[Quarter] = 2, Table[Ist]-Table[FCI],
        Table[Quarter] = 3, Table[Ist]-Table[FCII],
        Table[Quarter] = 4, Table[Ist]-Table[FCIII],
        "Quarter unknown"
 
Now I want to divide the result of Measure1 by Budget, FC I, FC II or FC III in dependency of the Quarter
and I get completely wrong numbers:
 
Measure2 =
SUMX(
    Table,
    SWITCH (
        TRUE (),
        Table[Quarter] = 1, DIVIDE(Table[Measure1] , Table[Budget]),
   Table[Quarter] = 2, DIVIDE(Table[Measure1] , Table[FCI]),
        Table[Quarter] = 3, DIVIDE(Table[Measure1] , Table[FCII]),
        Table[Quarter] = 4, DIVIDE(Table[Measure1] , Table[FCIII]),
        "Quarter unknown"
    )
)
 
Does someone see the error or is there maybe a better / more uncomplicated way to calculate that?
 
Many thanks.
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Pikachu-Power , Try measure 2 like

 

Measure2 =
divide([Measure1],
SUMX(
Table,
SWITCH (
TRUE (),
Table[Quarter] = 1, , Table[Budget],
Table[Quarter] = 2, , Table[FCI],
Table[Quarter] = 3, , Table[FCII],
Table[Quarter] = 4, , Table[FCIII],
blank()
)
) )

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Pikachu-Power , Try measure 2 like

 

Measure2 =
divide([Measure1],
SUMX(
Table,
SWITCH (
TRUE (),
Table[Quarter] = 1, , Table[Budget],
Table[Quarter] = 2, , Table[FCI],
Table[Quarter] = 3, , Table[FCII],
Table[Quarter] = 4, , Table[FCIII],
blank()
)
) )

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.