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
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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.