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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Sonnet
Helper I
Helper I

Stacked Bar Chart not showing correct values

Hi all, I have an issue. I have a stacked bar having on X axis Semester by Year from the Calendar Table, on the Y axis a measure that counts the current open risks based on the Risk Table. In the legend, Current Rating from the Risk Table.

 

Sonnet_0-1707428652825.png

The issue is that the rating changes whenever there is a change in the Current Rating in the Risk Table each semester instead of keeping the actual count each semester.


Here an example of the tables:

Risk Table

Risk Id Creation DateCurrent Rating for current semester
430/06/2023Medium
130/06/2022High
231/12/2022Low
330/06/2023Medium

 

Manually, every semester the current Rating for current semester is substitute with a new rating, and the old rating is stored in the Rating Table:

Risk IdSemester DateRating
130/06/2022Low
131/12/2022Medium
231/12/2022Low
230/06/2023High
330/06/2023Medium
331/12/2023Medium
430/06/2023Medium

If I use the Rating column from the Rating table in the legend, I get this:

 

Sonnet_1-1707428857284.png

 

On the data model side, the Calendar Date joins the Risk rating and the Risk table, and the Risk Rating actively joins the Risk table on the Risk Id.

Any help is much appreaciated.

2 REPLIES 2
amitchandak
Super User
Super User

@Sonnet , I think calendar should join to risk Rating and Risk should also join to risk rating

 

Try meausre like

 

Count of Risks by Historical Rating =
CALCULATE(
COUNTROWS('Rating'),
FILTER(
'Rating Rating',
'Rating Rating'[Risk Id] = 'Rating'[Risk Id]
&& 'Rating Rating'[Semester Date] <= MAX('Calendar Table'[Date])
)
)

 

 

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

When using your measure above, at this point:
'Rating Rating'[Risk Id] = 'Rating'[Risk Id]

the Rating[Risk Id] is not selectable. Only measures are displayed.

Any other way to solve it please?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors