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
WBarberena
Frequent Visitor

Line Graph Summing Separate Parameters

Greetings,

 

I found out PowerBI existed six months ago and now I am tasked with creating an implementation.  I love it so far.

 

My scenario: every day, five data points (including time) for 36 separate locations are generated. 

 

DateTimeLocationParamter 1Parameter 2Parameter 3Parameter 4
3/23/2023719LOCATION 12.640.272.300.006
3/23/2023813LOCATION 22.660.222.100.005
3/23/20231535LOCATION 32.550.232.300.007
3/23/20231650LOCATION 362.920.192.400.007

 

They are plotted on a line graph to track over time.

 

LineGraph.png

 

I have several slicers, one of which specifies parameters, that populates the graph with only the relevant data point per location.  The problem arises when two or more parameters are selected.  Instead of plotting separate points/lines for each parameter, the combination of selections is summed.  So for example, if I chose parameters 1, 2, and 3 for Location 1, instead of three plot points, 2.64, 0.27, and 2.30 respectively, the graph plots one point at 5.21.

 

I have other slicers that specify date ranges, locations, and even groups of locations.  Those works perfectly.  I used measures for each of the parameters because plotting the sums of the columns was giving me even more trouble.  Those measures all work fine:

Measure1 = SUM('Table'[Parameter1])

 

I don't know if the measure I use to plot them is the problem:

Parameter_Select =

SUMX (

    VALUES ( 'Sort_Parameters'[Parameter] ),

    SWITCH (

        'Sort_Parameters'[Parameter],

        "Paramter1", [Paramter1],

        "Paramter2", [Paramter2],

        "Paramter3", [Paramter3],

        "Paramter4", [Paramter4]

    )

)

 

I get no errors on any of my columns or measures.  I know 4 parameters for 36 locations yields 144 data points per day, but that's how it has to be (for now).  If someone could at least point me in the right direction I would appreciate it, as I have been looking for a solution and I'm not sure I'm even using the correct keywords.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@WBarberena , One way is unpivot the parameter to deal in a better way

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@WBarberena , One way is unpivot the parameter to deal in a better way

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

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.