Forum Discussion
Use Measure to return multiple values for a line graph
I have this measure below which returns a value based on slicers. It works well and currently returns 'All Projections'[FORECAST] to be on a line graph. Is there any way I can change this measure so that it can return TWO values to make two lines? In addition to [FORCAST] I also have [COUNTS] as a separate column in the same table.
Thanks!
VAR sitecount =
CALCULATE (
DISTINCTCOUNT ( 'All Projections Bridge'[site number] ),
ALLSELECTED ( 'All Projections Bridge' ),
ALLSELECTED ( 'All Projections Legend' )
)
VAR proccount =
CALCULATE (
DISTINCTCOUNT ( 'All Projections Bridge'[procedure number] ),
ALLSELECTED ( 'All Projections Bridge' ),
ALLSELECTED ( 'All Projections Legend' )
)
VAR levelnum =
SWITCH ( TRUE (), sitecount = 1, 3, proccount = 1, 2, 1 )
RETURN
CALCULATE (
SUM ( 'All Projections'[FORECAST] ),
'All Projections Legend'[Level] = levelnum
)
3 Replies
- SykResident Rockstar
A single measure won't be able to give you 2 different lines. But, you can create a new measure to look specifically at counts and add that to your chart!
- AnonymousNot applicable
I would do this, however; when you use two measures in the "values" section of the line graph, you can no longer have anything in the legend. The purpose of this measure is to use a dynamic legend/graph so that is not an option for me unfortunately.
- AnonymousNot applicable
Hi Anonymous ,
Please refer to the following topics.
https://community.powerbi.com/t5/Desktop/How-to-create-two-lines-in-a-line-chart/td-p/135098
If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.