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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Baddeck
Frequent Visitor

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

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

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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