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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mahra-in
Helper II
Helper II

Column Chart including Total

Hi

 

I need help in makin g column chart including total

 

I have a Table 1:

 

NameTypeDelivery
AExternalOn Time
BExternalOn Time
CInternalLate
DExternalOn Time
EInternalLate
FInternalLate
GExternalLate
HExternalLate
IExternalOn Time
JInternalOn Time
KInternalLate
LInternalLate

 

 

From the above Table 1, the on time delivery & their percentage on Total rows is

 

TypeOn Time%
External433%
Internal18%
Total542%

 

And the column chart as attached photo is what I need

Capture.PNG

 

 

Thanks in advance

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Try these measures:

 

On Time = CALCULATE(COUNTROWS(Data),Data[Delivery]="On time")

On Time (%) = [On Time]/CALCULATE(COUNTROWS(Data),ALL(Data))

 

Hope this help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ricardocamargos
Continued Contributor
Continued Contributor

Hi @mahra-in,

 

Try this new table:

 

TBL =
VAR tbl_1 = SUMMARIZE(
Table1;
Table1[Type];
"Ontime";
CALCULATE(COUNT(Table1[Delivery]); FILTER(Table1; Table1[Delivery] = "On Time"));
"%";
CALCULATE(COUNT(Table1[Delivery]); FILTER(Table1; Table1[Delivery] = "On Time")) / CALCULATE(COUNT(Table1[Delivery]); ALL(Table1))
)
VAR tb_row = ROW("Type"; {"Total"} ; "OnTime"; SUMX(tbl_1; [Ontime]); "%"; SUMX(tbl_1; [%]))
VAR tb = UNION(tbl_1; tb_row)

RETURN tb

 

Ricardo

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.