Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Lily36876
Helper II
Helper II

Customer Sales Range Analyze

Hi Guys

 

I got a new report develop request,but I have no idea.

 

Our sales team need to analyze customer's sales range 

But they want to choose price range and per gap by themself

For example:

They key in $1000~$10,000 use $1000 per gap

then count how many sales receip in this gap

 

so $1000~$10,000 and per gap

I have totolly 3 variable need filter to that user select

Lily36876_0-1690450247374.png

 

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Lily36876 ,

 

I'd set this up with a number of custom columns in Power Query, then swich between the different scenarios using field parameters.

For example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Hce5EQAxCAPAXhQ7OCPkpxaG/ts4TLYbgYkBo5zIEbAaz27z2Vwdr2zRbk816dB6qzZ96UPmDw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [saleID = _t, saleValue = _t]),
    chgTypes = Table.TransformColumnTypes(Source,{{"saleID", Int64.Type}, {"saleValue", Int64.Type}}),

// Relevant steps ----->
    addSale_1k =
        Table.AddColumn(
            chgTypes,
            "sale_1k",
            each Text.Combine(
                {
                    Text.From(Number.RoundDown([saleValue] / 1000, 0) * 1000),
                    Text.From(Number.RoundUp([saleValue] / 1000, 0) * 1000)
                },
                " - "
            ),
            type text
        ),
    addSale_5k =
        Table.AddColumn(
            addSale_1k,
            "sale_5k",
            each Text.Combine(
                {
                    Text.From(Number.RoundDown([saleValue] / 5000, 0) * 5000),
                    Text.From(Number.RoundUp([saleValue] / 5000, 0) * 5000)
                },
                " - "
            ),
            type text
        )
        
in
    addSale_5k

 

Example output:

BA_Pete_0-1690463820855.png

 

You can add as many different value ranges as you like and add them all into a Field Parameter so the end user can select which range type they use.

 

You just then need to add the parameter field to a table with a measure like this to get what you want:

__noofSales = DISTINCTCOUNT(yourTable[SaleID])

 

Pete

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Mahesh0016
Super User
Super User

@Lily36876 can you please share your End Out Put. Thank You!! 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.