Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Divide a number into 3 numbers

Hello, 

 

I have a problem with Power BI, I want to divide a number into 3 numbers, and output for exemple i want a table with these 3 values 

 

My number is for example, 110, so I want 3 integer numbers 

 

I want a table with these 3 values : 37, 37, 36 or 36, 36, 38 

 

It is possible to do that with Power BI and can you help me please ? I have no idea for this solution. 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous You could do something like this:

    Table 2 = 
        VAR __Number = MAX('Table'[Column1])
        VAR __Num1 = TRUNC(DIVIDE(__Number,3))
        VAR __Num2 = __Num1
        VAR __Num3 = __Number - __Num1 - __Num2
        VAR __Result = { __Num1, __Num2, __Num3 }
    RETURN
        __Result
    • Anonymous's avatar
      Anonymous
      Not applicable

      It works but it show an error when i try to display 

       

      There is error 53.5 "A table of many values has been show when an unique table was expected"