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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AshDil
Helper V
Helper V

Want to sum up Item ID values based on Category Id and Sub-category Id and show it axis of bar chart

Hi,

 

I have data as follows:

Category IDSub-Category IDITEM IDSales
100110010121000
100210020122000
100310030183000
100110010221200
100110010182000
1002100201181500

 

Now I want Item ID need to be sum up by Category ID and Sub-Category ID, the resultant Item ID need to be used as axis in column chart.

Eg: Category Id = 1001, Sub-category id = 100101 has two Item Id's = 2 & 8 (the resultant item id is sum of 2 and 8 = 10) and Sales Value = 3000

Now I need Item id = 10 to be used in "axis field" and sum of Sales = 3000 in "values field" of column chart. Same need to follow with other Category and Sub-category id's

Note: we don't use Category ID and Sub category Id in column chart.

Please help me to do it.

 

Thanks,

AshDil

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

One of ways to solve this is to create a new table like below.

Please check the below picture and the attached pbix file.

 

Picture4.png

 

New Table =
GROUPBY (
    Data,
    Data[Category ID],
    Data[Sub-Category ID],
    "@AxisItemID", SUMX ( CURRENTGROUP (), Data[ITEM ID] ),
    "@SumSales", SUMX ( CURRENTGROUP (), Data[Sales] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

One of ways to solve this is to create a new table like below.

Please check the below picture and the attached pbix file.

 

Picture4.png

 

New Table =
GROUPBY (
    Data,
    Data[Category ID],
    Data[Sub-Category ID],
    "@AxisItemID", SUMX ( CURRENTGROUP (), Data[ITEM ID] ),
    "@SumSales", SUMX ( CURRENTGROUP (), Data[Sales] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@AshDil , A new column

 

Sumx(Filter(Table, [Category Id] = earlier([Category Id]) &&  [Sub-category id] = earlier([Sub-category id]) ), [Item ID] )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.