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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

PRICE RANGE WITH DIFFERENT PARAMETER

Hi Guys,

 

I need help. We sell multiple item with different category. I need a DAX that will determine or create report base on different category with different  price range base. Example

 

 

CATEGORY    CATEGORY 2     PRICE  QTY SOLD
APPLE              FRUITS             300           4
BANANA          FRUITS            450            2
GRAPES           FRUITS             1000         7
DOG                ANIMALS         15000         8
CAT                 ANIMALS          700            2
GOAT              ANIMALS           5000         1
DRESS             CLOTHES           250           1
PANTS             CLOTHES           50            7
GOWN            CLOTHES         10000        10

 

 

SHEET 2

 


CATEGORY        ENTRY      MID                HIGH
FRUITS               0-300      301-999          above 1000
ANIMALS          0-5000      5001-10000    10001 above
CLOTHES           0-500         501-5000        5001 above

 

 

i want get total sold qty per category per price range. Hope you can help me.

 

thank you in advance

 

 

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Please apply below changes to Sheet2 in Query Editor mode.

 

Unpivot table.

1.PNG

 

Right click the [Value] column and select "Replace values". Then, split column.

3.PNG4.PNG5.PNG

 

In data view mode. Create calculated tables like below.

Sheet3 =
ADDCOLUMNS (
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS (
                Sheet1,
                "CATEGORY2", Sheet1[CATEGORY2],
                "PRICE", Sheet1[PRICE],
                "QTY SOLD", Sheet1[QTY SOLD]
            ),
            Sheet2
        ),
        [CATEGORY] = [CATEGORY2]
    ),
    "QTY", IF (
        [Max] <> BLANK ()
            && [PRICE] >= [Min]
            && [PRICE] <= [Max],
        [QTY SOLD],
        IF ( [Max] = BLANK () && [PRICE] >= [Min], [QTY SOLD], 0 )
    ),
    "Value Range", IF ( [Max] <> BLANK (), [Min] & "-" & [Max], "above " & [Min] )
)


Sheet4 =
SUMMARIZE (
    Sheet3,
    Sheet3[CATEGORY2],
    Sheet3[Range],
    Sheet3[Value Range],
    "Total QTY", SUM ( Sheet3[QTY] )
)

6.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft,

 

Good Afternoon,

 

Can you help about my problem?

 

Anyone who can help me?

 

 

Thank you,

 

Eanne

Anonymous
Not applicable

Hi GUys

 

Any help?

Anonymous
Not applicable

Hi @v-yulgu-msft,

 

Can you help me with regards to my new given data?

 

thank you,

 

Eanne

Anonymous
Not applicable

Hi Sir,

 

Thank you for immediate response. I forgot to incude that the 2 file have 1 connecting file. The masterfile (relationship)

 

FIRST FILE (MASTERFILE)

image.png

 

FILE 2 (with relationship in file 1 using item column)

 

 

image.png

 

 

FILE 3

 

already change the arrangement from previous file to lessen stepsalready change the arrangement from previous file to lessen steps

 

now need a DAX that will determine or create report base on different category with different  price range base.  using this 3 file

 

Category will be the basis of price range. 

i want get total sold qty per category per price range. Hope you can help me.

 

 

thank you so much in advance,

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.