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
IF
Post Prodigy
Post Prodigy

chart with grouped data

Hi,

I have the following data. I am using Name and Date columns at slicers. (the table looks stange, but should work with copy-paste).

 

NameStatusStatusKeyHoursDate

XOn time2112/2/2020
XOn time2212/2/2020
XOn time2-112/2/2020
XOn time2-212/2/2020
XOn time2012/2/2020
XOn time2312/2/2020
XOn time2312/2/2020
XOn time2312/2/2020
XLate3112/2/2020
XLate3212/2/2020
XLate3312/2/2020
XLate3812/2/2020
XLate31012/2/2020
XEarly1-112/2/2020
XEarly1-212/2/2020
XEarly1-212/2/2020
XEarly1-1412/2/2020
XEarly1-1112/2/2020
YOn time2012/2/2020
YOn time2-112/2/2020
YOn time2-312/2/2020
YOn time2-112/2/2020
YOn time2-212/2/2020
YOn time2212/2/2020
YOn time2312/2/2020
YOn time2312/2/2020
YOn time2312/2/2020
YLate3112/2/2020
YLate3212/2/2020
YLate3312/2/2020
YLate3812/2/2020
YLate31012/2/2020
YEarly1-112/2/2020
YEarly1-212/2/2020
YEarly1-212/2/2020
YEarly1-1412/2/2020
YEarly1-1112/2/2020
YLate3312/2/2020

 

I want to use a chart that show the count of the value:

x.jpgy.jpg

 

I made a column to show the count, but it sums and doesn't show with different colours.

HoursStatusDP = switch(true(),
'Table'[Hours] = 0 , "0 Hours",
'Table'[Hours] = 1, "+1 Hour",
'Table'[Hours] = 2, "+2 Hours",
'Table'[Hours] = 3, "+3 Hours",
'Table'[Hours] = 4, "+4 Hours",
'Table'[Hours] = 5, "+5 Hours",
'Table'[Hours] = 6, "+6 Hours",
'Table'[Hours] >= 7, ">=+7 Hours",
'Table'[Hours] = -1, "-1 Hour",
'Table'[Hours] = -2, "-2 Hours",
'Table'[Hours] = -3, "-3 Hours",
'Table'[Hours] = -4, "-4 Hours",
'Table'[Hours] = -5, "-5 Hours",
'Table'[Hours] = -6, "-6 Hours",
'Table'[Hours] <= -7, "<=-7 Hours",
"Unknown"
)
z.jpg
How can I show values with different colours? Green(on time) should always be at the bottom.
The file is also available at: https://gofile.io/d/56DLU1
All the best,
1 ACCEPTED SOLUTION

@IF 

Please check if what you will find at pag 4 could help you. 

 

https://1drv.ms/u/s!Ah7_1Sua__g-60KSBWTyNS_d1Udf?e=j7mZSw 

 

Regards

If I can...

View solution in original post

5 REPLIES 5
IF
Post Prodigy
Post Prodigy

Hi, Thanks for the reply. However, I want to group the data in some bars. -2 days, -1day, 1day, 2days and 3 days bars have two different type of data. For example; Name X: -2 days/hours is 3 in total. However, 2 of 3 is for early and 1 is for on time. Similarly, 3 days/hours is in total 4. However, 3 of 4 is on time and 1 of 4 is late. Early should be yellow, ontime is green and late is red. As you see at the post, these bars have two different colours. I want to do it in this way. If I change as you mentioned, it changes the whole bar.

All the best

gpiero
Skilled Sharer
Skilled Sharer

@IF

 

Something like this, right?

And for each bar you would like to displaly X + Y, right? (now you can see only X)

 

Pict999.png

If I can...

@IF 

Please check if what you will find at pag 4 could help you. 

 

https://1drv.ms/u/s!Ah7_1Sua__g-60KSBWTyNS_d1Udf?e=j7mZSw 

 

Regards

If I can...

It is exactly what I wanted. Thanks a looot!

gpiero
Skilled Sharer
Skilled Sharer

@IF

 

Hi

You could use the option for Data colors to have different colors

 

pict100.png

 

pict10.png

 

Regards

If I can...

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.