Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Numerical Column Issue

Hi all, I`m currently working as part of a project converting a large number of Spotfire reports to Power BI. One of the reports has a small number of scatter plots that refer to a column made up of ...
  • DataNinja777's avatar
    2 years ago

    Hi Anonymous ,

     

    From your description, I understood that you want to bucket the numerical values in the column instead of the numerical output of a measure, in which case, you can achive your required output by just utilizing the calculated column like below next to your column.  

     

    Fluid Depth =
    SWITCH (
        TRUE (),
        'Table'[Value] < 200, "<200",
        'Table'[Value] >= 201
            && 'Table'[Value] < 500, "201-500",
        'Table'[Value] >= 501
            && 'Table'[Value] < 800, "501-800",
        'Table'[Value] >= 801
            && 'Table'[Value] < 1000, "801-1000",
        ">1000"
    )

     

     In order to sort the text values in the numerical bucket order, I've also added the calculated sort column like below.  

     

    # = switch(true(),
    'Table'[Value]<200,1,
    'Table'[Value]>=201&&'Table'[Value]<500,2,
    'Table'[Value]>=501&&'Table'[Value]<800,3,
    'Table'[Value]>=801&&'Table'[Value]<1000,4,
    5)
    

     

    Then used summarize function to summarise the bucket grouping table and created a relationship with your fact table. 

     

    I've then done the countrow of the fact table and put in the bucket sorted out by numerical sort order, which happen to show distribution like below.  

    I attach an example pbix file. 

    Best regards,