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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Sandeep130493
Regular Visitor

Show subtotal in bar chart

Hello Experts,

 

I want to show subtotal % of categoary like below in my bi report

 

Sandeep130493_0-1672745087425.png

 

 

We are manully copying below data based on categoary and paste in the background of above chart.

Sandeep130493_1-1672745342959.png

 

I am able to to make it till catogary. not sure how to show subtotal in bar chart like above excel dashbaord.

Below is sample data for your reference.

 

I want to show small ticket total,Medium ticket total,Large ticket total % (Small Ticket Total / Grand Total )

) in bar chart in below powerbi chart .same like excel above chart.

 

Sandeep130493_2-1672745588446.png

 

Ticket_BandsCategory_1FY22 Q4FY23 Q1Grand Total  
Small TicketFOR104103207  
 HFC337242447858202  
 NBF271021988746989  
 OTH435528887243  
 PUB253151876044074  
 PVT184511322831679  
Small Ticket Total 1090507934518839514%12%
Medium TicketFOR185818253683  
 HFC5918851839111027  
 NBF8348878244161732  
 OTH393025536483  
 PUB6997454311124286  
 PVT9784182398180240  
Medium Ticket Total 31627927117158745041%42%
Large TicketFOR118771032622203  
 HFC273722767055042  
 NBF5474050098104838  
 OTH7990543913430  
 PUB10910678459187566  
 PVT141968123671265639  
Large Ticket Total 35305429566364871745%46%
Grand Total 7783836461801424563  

@rebii @myMicrosoft @ExpertBM @Anonymous @Supookeed @AlwaysBI @Bibi @PowerJ 

3 REPLIES 3
Sandeep130493
Regular Visitor

Thanks for your help brother.

@v-yangliu-msft .

 

I wanted to show top 3 Category of each brand with subtotal. like showing below in excel highlighted

 

Sandeep130493_5-1672838252853.png

I am using dense rank function 

Ranks_Wise =
 Var a = RANKX(ALLEXCEPT('Table 2','Table 2'[Ticket_Bands]),
CALCULATE('Table 2'[Q4]
,ALLEXCEPT('Table 2','Table 2'[Category_1])),,DESC,Dense)
Return
a
 
I want show top 3 category of each brand using rank . but want to show top 3 and small ticket subtotal / Medium and large ticket . like showing in above excel screenshot
Sandeep130493_6-1672838331192.png
 Thanks for your help 🙂

 

 

 

 

 

v-yangliu-msft
Community Support
Community Support

Hi  @Sandeep130493 ,

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
CROSSJOIN(
DISTINCT('Table'[Ticket_Bands]),
UNION(
DISTINCT('Table'[Category_1]),
DISTINCT('Table'[Ticket_Bands])))

vyangliumsft_0-1672815921254.png

2. Create measure.

Cate Q1 =
var _sum1=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])&&'Table'[Category_1]=MAX('Table 2'[Category_1])),[FY23 Q1])
var _sum2=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])),[FY23 Q1])
return
DIVIDE(_sum1,_sum2)
Cate Q4 =
var _sum1=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])&&'Table'[Category_1]=MAX('Table 2'[Category_1])),[FY22 Q4])
var _sum2=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])),[FY22 Q4])
return
DIVIDE(_sum1,_sum2)
Ticket Q1 =
var _sum1=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])),[FY23 Q1])
var _sum2=
SUMX(ALL('Table')
,[FY23 Q1])
return
DIVIDE(_sum1,_sum2)
Ticket Q4 =
var _sum1=
SUMX(FILTER(ALL('Table') ,
'Table'[Ticket_Bands]=MAX('Table 2'[Ticket_Bands])),[FY22 Q4])
var _sum2=
SUMX(ALL('Table')
,[FY22 Q4])
return
DIVIDE(_sum1,_sum2)
Q1 =
SWITCH(
    TRUE(),
   MAX('Table 2'[Ticket_Bands]) =MAX('Table 2'[Category_1]) ,[Ticket Q1],
'Table'[Cate Q1])
Q4 =
SWITCH(
    TRUE(),
   MAX('Table 2'[Ticket_Bands]) =MAX('Table 2'[Category_1]) ,[Ticket Q4],
'Table'[Cate Q4])

3. Close Show items with no data.

vyangliumsft_1-1672815921256.png

4. Result:

vyangliumsft_2-1672815921262.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Sandeep130493 , You might have added an additional item in dimension or extended dimension

 

https://amitchandak.medium.com/power-bi-add-grand-total-row-in-the-bar-visual-44c3d1d463be

 

or

Power BI How to get the P&L formatting right: https://youtu.be/C9K8uVfthUU

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.