The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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!
Solved! Go to Solution.
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]))
)
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.
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.
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