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

Line Graph

I have data for sites for H1 H2 of each year scoring 0 to 3 named as Low, Medium, High,Critical, So everytime site record is captured should always fall between 0 to 3 score. I need graph which shows No of sites in H1 H2 of each year falling under category, but if a site falling under category of 2 in H2 and doesnot consist data for H1 then by default the line for H1 should start from 0 .

1 ACCEPTED SOLUTION

Hi @PRAVINV  - create a measure will count sites by Risk_Level while filling in missing data with zeros.

SitesCount =
VAR SelectedYearHalf = SELECTEDVALUE('Data'[AssessmentYear])
VAR SelectedRiskLevel = SELECTEDVALUE('Data'[Risk_Level])
RETURN
CALCULATE(
DISTINCTCOUNT('Data'[Site_Name]),
'Data'[AssessmentYear] = SelectedYearHalf,
'Data'[Risk_Level] = SelectedRiskLevel
) + 0

 

add this measure in your y-axis .

 

reg. tooltip, we have tooltip section of your visual, add Site_Name.Ensure the Y-Axis is set to the SitesCount measure, not to Site_Name directly.In the Format Your Visual pane, under Y-Axis, disable Concatenate Labels and Show all items (if applicable).

Hope this works in your case.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

7 REPLIES 7
PRAVINV
Regular Visitor

PRAVINV_0-1741002081349.png

 

I have custom tooltip created as above for site name but on line graph it shows all the sites on Y axis for all Risk Level

PRAVINV
Regular Visitor

Also how can I have only sites reflecting as tooltip at each datapoint, cause for me list of all sites on Y axis is reflecting

Hi @PRAVINV  - create a measure will count sites by Risk_Level while filling in missing data with zeros.

SitesCount =
VAR SelectedYearHalf = SELECTEDVALUE('Data'[AssessmentYear])
VAR SelectedRiskLevel = SELECTEDVALUE('Data'[Risk_Level])
RETURN
CALCULATE(
DISTINCTCOUNT('Data'[Site_Name]),
'Data'[AssessmentYear] = SelectedYearHalf,
'Data'[Risk_Level] = SelectedRiskLevel
) + 0

 

add this measure in your y-axis .

 

reg. tooltip, we have tooltip section of your visual, add Site_Name.Ensure the Y-Axis is set to the SitesCount measure, not to Site_Name directly.In the Format Your Visual pane, under Y-Axis, disable Concatenate Labels and Show all items (if applicable).

Hope this works in your case.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





working perfect, Thank you very much for the graph.  

PRAVINV
Regular Visitor

BusinessRegionSite_NameScoresRisk_LevelAssessmentYear
XYZEEESite11Medium2024 - H1
XYZEEESite10Low2024 - H2
XYZEEESite12High2025 - H1
ABCDDDSite20Low2024 - H1
ABCDDDSite22High2024 - H2
ABCDDDSite21Medium2025 - H1

Data is as above

PRAVINV_0-1740997588618.png

 

rajendraongole1
Super User
Super User

Hi @PRAVINV  - Can you please share some sample data for reference and expected output? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.