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
Anonymous
Not applicable

How can i get each separate line for each legend

Please see the attached screen shot. If i select two years 2018 and 2019 (from the slicer) and two or more values (in this case 2 ) how can i get four lines in the plot area, is that even possible 

one for 2018 Fabric, one for 2019 fabric, one for 2018 mech and one for 2019 mech. Please suggest.

ThanksCapture723b.PNG

 

1 ACCEPTED SOLUTION


@Anonymous wrote:

I went ahead and created the measure...


Thats your issue. You need to be creating a new column with this button: Capture.PNG

Columns add a new value to each row, and that new value is what you will be using to sort your visual.

View solution in original post

10 REPLIES 10
ntaylo06
Resolver II
Resolver II

This may not be the "cleanest" approach but an easy way to do it would be with a new calculated column. The formula: 

Unique Category/Year = 'Table'[Category] & " " & 'Table'[Year]

should give a field that says "Fabric 2019" where "Fabric" is the value of the category and "2019" is a year value. You can then set those to your legend and it should give 4 (or more) lines.

 

Anonymous
Not applicable

when i am using 

Measure='AllcompletedUnpivot'[Category]& " " &  'AllcompletedUnpivot'[Year]

and without quotes

Measure=AllcompletedUnpivot[Category]& " " &  AllcompletedUnpivot[Year]

I am getting an error  cannot find name '[Category]' ,  cannot find name '[Year]'

please see my fields , the table is a direct query and not a Table by itslef in the database, its a sql query based off the main table

Capture724.PNG

Can you please post a screenshot of your data?

Anonymous
Not applicable

I went ahead and created the measure ignoring the errors. Now when i hover the exclamatory mark i see the following message

"A single value column 'Category' in table 'AllcompletedUnpivot' cannot be determined. This can happen when a measure formula refers to a column that contains many values wothout specifying an aggregation as min , max , count or sum to get a single result."

Please see attached screen shot of the data 

Capture724a.PNG


@Anonymous wrote:

I went ahead and created the measure...


Thats your issue. You need to be creating a new column with this button: Capture.PNG

Columns add a new value to each row, and that new value is what you will be using to sort your visual.

Anonymous
Not applicable

Wow thank you so much natylo06 that made my day , new thing learnt will save this in my notes for the pros and cons of power bi. My only complain is why does power bi market itself as user friendly when simple reqs like this need to be customized unlike Tableau . I have used tableau with no customizations for these kind of small things.

ANyways thanks again !

No problem!


@Anonymous wrote:

... My only complain is why does power bi market itself as user friendly when simple reqs like this need to be customized...


Technically you can use Power BI without ever having to learn Power Query or DAX, which is a pretty big help. The query editor and quick measure tools are powerful ways to avoid having to do any coding. The downside is that if you don't know how these languages work then you are stuck with the "user friendly" buttons that Power BI gives you.

Anonymous
Not applicable

Hmm with powerbi i never excpected an easy way out 🙂 , the problem is here what if i need to show data for 3 years and if i have to select all the 10 values from the category slider?


@Anonymous wrote:

the problem is here what if i need to show data for 3 years and if i have to select all the 10 values from the category slider?


As long as there is more than one combination of [Category] and [Year] this solution will work. You could do it for 20 years and 100 categories and it would still plot all of those combinations on seperate lines.

Anonymous
Not applicable

Thanks my dataste is a direct query and when i create a new measure it is not identifying the dataset name. It is showing that the table name not found.

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.