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
Testsubjec
Regular Visitor

Filter Values for a Line Chart

Hi,

I'm new to Power BI, so apologies if this is a really simple question to answer. 

I've created a Line Chart to display number of API Requests by Year / Month.

Testsubjec_0-1620752747709.png

I'd like to add another series to the chart to show number of failed requests but I'm struggling to understand how to do this. I have a HttpStatusCode field, in short count the number of Id's whereby the HttpStatusCode <> 200.

Again, apologies if this sounds very simple.

 

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Testsubjec ,

 

you can do that with a measure.

Try the following:

Status not 200 = CALCULATE( SUM(myTable[API Requests]), mytable[HttpStatusCode] <> 200)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Testsubjec ,

Just as selimovd said ,try  the below:

Status not 200 = CALCULATE( SUM(myTable[API Requests]), mytable[HttpStatusCode] <> 200)

Or (if API Requests is Access log)

Status not 200 = CALCULATE( distinctcount(myTable[API Requests]), mytable[HttpStatusCode] <> 200)
If your problem  has been solved, if so, please consider Accept a correct reply as the solution to help others find it.

If still not work ,could you pls share your pbix file,remember to remove confident data.

 

Best Regards

Lucien

selimovd
Super User
Super User

Hey @Testsubjec ,

 

you can do that with a measure.

Try the following:

Status not 200 = CALCULATE( SUM(myTable[API Requests]), mytable[HttpStatusCode] <> 200)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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.