Chart counting cells within a ranged number value

Hi,
Pls help. I have a number type column called [Distance] and i wanted to make a chart showing based on conditions that for example, count all the cells that belongs to a range like from 0 to 9.99 and likewise count all cells having values that are equal 10 and above. Canโ€™t seem to figure out how.

Solved Solved
0 5 292
1 ACCEPTED SOLUTION

You need to construct 2 Virtual Columns for that initially and then use this 2 columns for your charting:

COUNT(
    SELECT(
        TableName[Distance],
        AND(
            [Distance]>=0.00,
            [Distance]<=9.99
        )
    )
)
COUNT(
    SELECT(
        TableName[Distance],
        [Distance]>=10.00
    )
)

View solution in original post

5 REPLIES 5

You need to construct 2 Virtual Columns for that initially and then use this 2 columns for your charting:

COUNT(
    SELECT(
        TableName[Distance],
        AND(
            [Distance]>=0.00,
            [Distance]<=9.99
        )
    )
)
COUNT(
    SELECT(
        TableName[Distance],
        [Distance]>=10.00
    )
)

Thank you @LeventK, already working good for each column, but how can i combine these 2 columns to show in a single chart view (say for a histogram chart, those 2 values from the 2 columns will appear next to each other) ? TIA

If I may add to excellent guidance by @LeventK, for your this new requirement you could have a virtual column , called say [ Distance Categoeries] with an expression something like below

IFS( [Distance]<=9.9 , โ€œCategory 1โ€, [Distance]>9.9, โ€œCategory 2โ€) and so on. Please name the categories as you want.

Now you could have a histogram built on this column [ Distance Categoeries] and with group aggregate setting as โ€œCountโ€

Amazing! Huge help, Thank you @LeventK & @Suvrutt_Gurjar, both solutions were useful. Kudos!

Youโ€™re welcome

Top Labels in this Space