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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vindai101
Frequent Visitor

Plot Independent Line Chart that bypass other slicer but the some

Hello,

 

I need some help figuring this out, I have already spent quite a time on it.
I'm wanting to create a line chart that picks certain Accounts determined by some Slicers and create a line chart for those account for the provided Date Range from the slicer.  
The Chart should look like this, without handpicking the Account Slicer on the left.

vindai101_0-1711492212571.png

 

When not handpicked it looks like this :

vindai101_1-1711492383320.png

 

Any help is highly appreciated.

Thank you

 

11 REPLIES 11
vindai101
Frequent Visitor

Thank you so much for your help sir,
Ranking works with the date ranges now, thank you. 
Wondering how can we make it inclusive of other two silcers , Average and Differecnce including the date range and picks the TOP% and output the chart for the entire date range for those TOP% accounts. I did something like this in the DAX but doesn't seem to be working. So sorry to keep bugging you, really appreciate all your help.

TopN Vendor =
var t = SELECTEDVALUE('Top Vendor Table'[Value])
var d = ALLSELECTED('Calendar'[Date])
var v = SELECTEDVALUE(Data[VENDOR_ACCOUNT])
var s = ALL(Data[VENDOR_ACCOUNT])

var DiffAmt = ALL(Data[ABS Diff Amount])
var AvgAmt = ALL(Data[AVERAGE_AMOUNT])

var u = ADDCOLUMNS(s,"amt",var ve=[VENDOR_ACCOUNT]
return CALCULATE(
    sum(Data[ABS Diff Amount])
    ,d,DiffAmt,AvgAmt,
    Data[VENDOR_ACCOUNT]
  =ve))
var w = topn(t,u,[amt],DESC)
return
if(
    countrows(filter(w,[VENDOR_ACCOUNT]=v))>0,1,0)
 
 
Thank you
 
vindai101_0-1711751669171.png

 

vindai101
Frequent Visitor

Hello sir, it works. you are a saviour. Thank you so much.
It works perfectly for the Date Range, however how can we to make it to take in into accout for the additional Average and Variance silcer ranges so it picks the TOP% within those ranges. 
 I tried adding something like this in the DAX, but doesn't seem to work.

TopN Vendor 2 =
var t = SELECTEDVALUE('Top Vendor Table'[Value])
var d = ALLSELECTED('Calendar'[Date])
var v = SELECTEDVALUE(Data[VENDOR_ACCOUNT])
var s = ALL(Data[VENDOR_ACCOUNT])

var DiffAmt = ALL(Data[ABS Diff Amount])
var AvgAmt = ALL(Data[AVERAGE_AMOUNT])

var u = ADDCOLUMNS(s,"amt",var ve=[VENDOR_ACCOUNT]
return CALCULATE(
    sum(Data[ABS Diff Amount])
    ,d,DiffAmt,AvgAmt,
    Data[VENDOR_ACCOUNT]
  =ve))
var w = topn(t,u,[amt],DESC)
return
if(
    countrows(filter(w,[VENDOR_ACCOUNT]=v))>0,1,0)
So sorry to keep bugging you. 
Thank you
vindai101_0-1711750254715.png

 

vindai101
Frequent Visitor

Yes sir, thank you, any ideas how to write DAX for that, please.

lbendlin
Super User
Super User

"Nothing selected"  is the same as "all selected" .  Power BI cannot distinguish between your scenarios.  It would be confusing for your users anyway.  Let your users pick all of the values as needed.

Appreciate your response Ibendlin. I believe I didn't put the issue correctly lol
What I'm trying to do is for the Chart to plot only for those specific Accounts for the date range that meets the parameter/slicer criteria and not list all the Accounts that is available in the data, regardless of selecting Account.
Default chart looks like this (below), but I'm trying to achieve the one shown on 1st picture.

vindai101_0-1711504926130.png

 


Hope this clears. Really appreciate your time responding earlier.
Thanks again

not clear to me.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hello sir, upload the pbix file into the google drive. Hoping this will help more, here's a link to it.
https://drive.google.com/drive/folders/1Re5cP7-YxYaE9LKglVeP8y3yGyYJJyua?usp=sharing

 

Thank you

TopN Vendor = 
CALCULATE(
    [Total Amount],
    KEEPFILTERS(
TOPN(
    SELECTEDVALUE('Top Vendor Table'[Value]),
    ALLSELECTED(Data[VENDOR_ACCOUNT]),
    [ABS Diff Amount]
)
)
)

This will be recalculated for each Date point, and thus return a result different from what you expect.  You need to reformulate it to find if a given Vendor is part of the Top 5 across the entire selected date range.

Yes sir understood and thank you, but any ideas writing DAX for that please.

Something like this (cobbled together in a hurry)

TopN Vendor = 
var t = SELECTEDVALUE('Top Vendor Table'[Value])
var d = ALLSELECTED('Calendar'[Date])
var v = SELECTEDVALUE(Data[VENDOR_ACCOUNT])
var s = ALL(Data[VENDOR_ACCOUNT])
var u = ADDCOLUMNS(s,"amt",var ve=[VENDOR_ACCOUNT] return CALCULATE(sum(Data[ABS Diff Amount]),d,Data[VENDOR_ACCOUNT]=ve))
var w = topn(t,u,[amt],DESC)
return if(countrows(filter(w,[VENDOR_ACCOUNT]=v))>0,1,0)

Adjust as needed

Thank you so much, I'll look into it and update you. 

Thanks again

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors