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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
mit1
Helper I
Helper I

1 measure display multiple lines in line chart

Hi all,

May I check if it is possible for 1 measure to display 3 lines on my line chart?

mit1_1-1710908673810.png

 

My goal is to simplify my measures, as the only difference between "Active Power (kW) - Phase R" & "Active Power (kW) - Phase S" is the column value the measure calculates from (i.e. MAX('Customer1'[Body_W_R] & MAX('Customer1'[Body_W_S]).


Thank you in advance!

1 ACCEPTED SOLUTION
mit1
Helper I
Helper I

I have found a solution to my problem.

Regardless of whether the 3 columns are independent of each other ([Body_W_R], [Body_W_S] & [Body_W_T]).

All you have to do is to create a measure table with R, S, T values. Create a slicer for this RST and using the same RST as the legend. In order to link the measure to the RST slicer use the following example SWITCH logic:

VAR SelectedGaugeValue =
    SWITCH(
        SELECTEDVALUE('R/S/T_ChartElements'[Select R/S/T]),
        "R", FIRSTNONBLANK('Customer1'[Body_W_R], 1),
        "S", FIRSTNONBLANK('Customer1'[Body_W_S], 1),
        "T", FIRSTNONBLANK('Customer1'[Body_W_T], 1),
        BLANK()
    )

(Edit according to the function you're using)

This will enable you to use the RST measure table slicer to swap between measures display. Such that when I select R,  [Body_W_R] will display, and if i select R & S,  both [Body_W_R] &  [Body_W_S] would display.

View solution in original post

4 REPLIES 4
mit1
Helper I
Helper I

I have found a solution to my problem.

Regardless of whether the 3 columns are independent of each other ([Body_W_R], [Body_W_S] & [Body_W_T]).

All you have to do is to create a measure table with R, S, T values. Create a slicer for this RST and using the same RST as the legend. In order to link the measure to the RST slicer use the following example SWITCH logic:

VAR SelectedGaugeValue =
    SWITCH(
        SELECTEDVALUE('R/S/T_ChartElements'[Select R/S/T]),
        "R", FIRSTNONBLANK('Customer1'[Body_W_R], 1),
        "S", FIRSTNONBLANK('Customer1'[Body_W_S], 1),
        "T", FIRSTNONBLANK('Customer1'[Body_W_T], 1),
        BLANK()
    )

(Edit according to the function you're using)

This will enable you to use the RST measure table slicer to swap between measures display. Such that when I select R,  [Body_W_R] will display, and if i select R & S,  both [Body_W_R] &  [Body_W_S] would display.

Uzi2019
Super User
Super User

Hi @mit1 
If your one Measure is calculated with single column/multiple columns and you want to distribute across different values for example Sales(Measure) across different years that's possible with Legends option.
But if you are creating different measures based on different columns. for example Sales(p1) , Sales(p2), Sales(p3) ,  then you have to take all three measures in you line chart. beacuse all measures are on different calculation. they are seperate cant be part of 1 measure.


I hope I anwered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
FarhanAhmed
Community Champion
Community Champion

You can break lines using legend 

 

FarhanAhmed_0-1710910136557.png

 

 

 

but in this case your measure/column should be derived from single measure.







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Hi @FarhanAhmed ,

Unfortunately, i do not have a common data to be used for legend, so this may not be possible.
These 3 columns are independent of each other, and these are labelled [Body_W_R], [Body_W_S] & [Body_W_T].

Currently I have a slicer with R, S, T as measure table values.

So my dax (simplified) is: 

PhaseS = IF(CONTAINS('R/S/T_GaugeElements', 'R/S/T_GaugeElements'[Select R/S/T], "S"), MAX('Customer1'[Body_W_S]),BLANK())


My goal is to use a slicer to swap between measures display. Such that when I select R,  [Body_W_R] will display, and if i select R & S,  [Body_W_R] &  [Body_W_S] would display.

How should this be accomplished?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.