Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Circular dependency calculated column

I have a measure for which I then have a calculated column that groups rows depending of the value that the meaure returns. I then have a table that I created in Power BI with the purpose of sorting...
  • joaoribeiro's avatar
    joaoribeiro
    3 years ago

    Thank you Anonymous ,

     

    I suggest you to try creating the sorting column directly from the original table, with the calculation of the grouppering inside it's formula, as shown below. After that, sort the gruppering calculated column by the new sorting column:

    Sorting Gruppering = 
    
    SWITCH(
    TRUE(),
    'Fact Table'[Measure] = 0, 0,
    'Fact Table'[Measure]  >= 1 && 'Fact Table'[Measure]  <= 2, 1,
    'Fact Table'[Measure] >= 3 && 'Fact Table'[Measure]  <= 5, 2,
    'Fact Table'[Measure]  >= 6 && 'Fact Table'[Measure]  <= 10, 3,
    'Fact Table'[Measure]  >= 11 , 4
    )

     

    With that, you should not have circular refference issues between the columns, as they are not reffering to each other.

     

    Hope this answer solves your problem!
    If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

    Thanks!
    Best regards,
    Joao Ribeiro