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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.