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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sravan872
Frequent Visitor

Need help in Line Chart

I have a table with Fund Code, Tracking Error, Aladdin Tracking, Effective Date Error etc and a caledar table joined with effective date in Fund Table. I am representing AVERAGE(Aladdin Tracking error) by Month_Year in a line chart with fund code in slicer.

Currently it shows a single line if i select multiple funds also in the slicer by aggregating the Aladdin tracking error.

 

The requirement is when i select multiple funds in the slicer, the line chart should show seperate line for each fund - for this I added fund code into the legend and it worked. As there are many funds the line chart became a huge mess.

 

The new requirement is, If i select multiple funds int he slicer the line chart should separate lines for each fund and IF i dont select anything in the fund code slicer there should be a single aggregated line for all the funds.

 

PLease hep!

1 ACCEPTED SOLUTION

Thanks @OwenAuger This is exactly what I needed! Cheers!

View solution in original post

3 REPLIES 3
SamWiseOwl
Super User
Super User

Hi @sravan872 

 

Interesting problem!
What I would do is create the illusion of one line by having them all become stacked.
This measure checks if the number of filtered Funds is equal to the total number of funds.

If the number is different we know a filtered has been appplied and to show the original value otherwise show the over all value by removing the fund filter.

 

 

 

Is Filtered = 
SWITCH(
    TRUE()
    ,CALCULATE(COUNT(Region[RegionName]),ALLSELECTED(Region[RegionName])) 
    <> --If the number of funds does NOT match the filtered funds
    CALCULATE(COUNT(Region[RegionName]),ALL(Region[RegionName]))
    ,Sum(Purchase[Quantity]) --Show the sales for each fund
    --If the visual is NOT filtered show the total instead
    ,CALCULATE(SUM(Purchase[Quantity]), ALL(Region[RegionName]))
)

 

 

 

SamWiseOwl_0-1741344264505.png

 

SamWiseOwl_1-1741344309768.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

OwenAuger
Super User
Super User

Hi @sravan872 

This is very similar to the problem on another thread with the solution post here with some instructions on setting it up.

 

The basic idea is to create a special field parameter to use as the Legend field on the visual.

In your case, the field parameter would include two items: Fund Code & a BLANK item.

You then create a measure that detects whether Fund Code is filtered, and allows the correct field parameter item to be selected.

  • If Fund Code is filtered then Legend = Fund Code
  • If Fund Code is not filtered then Legend = BLANK

I have re-attached the same demo PBIX included on the solution linked above (ISO Code is comparable to your Fund Code in this model).

 

Are you able to get something like this working?

Please post back with specifics on your model or a sanitised PBIX if you can.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thanks @OwenAuger This is exactly what I needed! Cheers!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors