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
devika
Helper II
Helper II

slicer - Line chart with selected value and overall value

Hi

 

Thanks for your time.

 

I'm creating a line graph showing the total sales and also by region in the same graph.

  • Total sales by year should always be displayed.
  • When a user doesn't select any region, only show the total by year.
  • When a user select a region/regions,show the regions as a separate line and overall total(all the regions total not only selected regions total).
  • Don't show "total" as an option in the slicer.

 

Any advice is much appreciated.

 

Year

RegionSales
2018A100
2018B200
2018C300
2019A400
2019B500
2019C600
2020A700
2020B800

 

 

devika_4-1711587961073.png

 

3 REPLIES 3
Shreeram04
Resolver III
Resolver III

Hi @devika ,

 

Please create the two below-mentioned measurements and add them to your line chart.

1. Total Sales = SUM('Table'[Sales])
 
2. Total Sales Selected =
IF (
    ISFILTERED('Table'[Region]),
    CALCULATE(SUM('Table'[Sales]), ALL('Table')),
    SUM('Table'[Sales])
)
 
While select value in the filter it show both total and selected region 
Shreeram04_0-1711602763423.png

 

 when nothing is selected it shows the total value only

Shreeram04_2-1711602899068.png

 

If this post helps, then please consider Accept it as the solution 

Thanks,

Hari

 

@Shreeram04 - Thanks for your time.sorry not really,

  1. I need to show 600,1500,1500 for total by year (always)

 2.  If region A is selected then 100,400,700 ( as a single line for Region A by Year)

3.   If region A and B are selected then 100,400,700 ( as a single line for Region A by Year )  200,500,800 (as a single line for Region B by Year)

devika_0-1711603308818.png

 

Hi - I am taking a step back to show the grand total and just changed the slicer to single select, so it is working fine in this case.

Can anyone please advise if multiselection in the slicer is possible and also show the regions and  lines/plots separately ?

I have seen the post to create parameter but this won't work in the scenario as I need to produce three different graphs - Profit, Loss, Sales interacting to one Region slicer

devika_0-1711687277340.png

 Measures: (similarly created for Profit)

 

Total_Loss_line = CALCULATE(sum('Table'[Loss]),All('Table'[Region]))
 
Total_Loss_Selected =
IF (
    ISFILTERED('Table'[Region]),
    CALCULATE(SUM('Table'[Loss])),
    SUM('Table'[Loss])
)
 
 

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.