Reply
Baddeck
Frequent Visitor
Partially syndicated - Outbound

Slicer for line chart - how to show 3 options and-or a sum of all options?

ie a slicer & line chart (months on x-axis) with lines for Texas, Oklahoma, and Arkansas, with an option to show just one line showing the sum of all 3. Total line/option has me stumped. Select All shows 3 lines not 1

 
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Syndicated - Outbound

Hi @Baddeck .
You can choose between the countries and the total by using field parameters.
This is how it works:
1. Create measure for every country using "calculate" function :

SumArkansas = CALCULATE(sum('Table'[value]),'Table'[Country]="Arkansas"
2. Create measue for "Total"
SumTotatal = CALCULATE(sum('Table'[value]),all('Table'[Country]))
3. Create a field parametrs with your measures
Ritaf1983_0-1682035517908.png

 

Ritaf1983_1-1682035602409.png

4. Put a parametr that you created as a value of Y axis on your line chart:

Ritaf1983_2-1682035756909.png

 results:

Ritaf1983_3-1682035836933.png

 

I have also prepared a sample file.
Here is the link to download it:
https://drive.google.com/file/d/1xhVXFE-b2yfTw0qs6zyLCs1itSaPhITf/view?usp=sharing 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Syndicated - Outbound

Hi @Baddeck .
You can choose between the countries and the total by using field parameters.
This is how it works:
1. Create measure for every country using "calculate" function :

SumArkansas = CALCULATE(sum('Table'[value]),'Table'[Country]="Arkansas"
2. Create measue for "Total"
SumTotatal = CALCULATE(sum('Table'[value]),all('Table'[Country]))
3. Create a field parametrs with your measures
Ritaf1983_0-1682035517908.png

 

Ritaf1983_1-1682035602409.png

4. Put a parametr that you created as a value of Y axis on your line chart:

Ritaf1983_2-1682035756909.png

 results:

Ritaf1983_3-1682035836933.png

 

I have also prepared a sample file.
Here is the link to download it:
https://drive.google.com/file/d/1xhVXFE-b2yfTw0qs6zyLCs1itSaPhITf/view?usp=sharing 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)