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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
ppraca
Frequent Visitor

Disconnected table alter the filter context

Hi,

I'm working in an Excel Pivot table, and I have a disconnect table: TopN value.

My model:

ppraca_0-1721900209862.png

In the disconnected table I have the following measure: TopN_Value= =SELECTEDVALUE('topN'[TopN value])

In the following filter context everything is ok:

ppraca_1-1721900636202.png

 

But when I drag the TopN_Value measure to the table, it ignore the filter context, and list all the row values for "TARIFA". I think this not happen in Power Bi.

 

ppraca_3-1721900939582.png

 

 

Thanks,

Paulo Praça

 

 

3 REPLIES 3
shafiz_p
Super User
Super User

Hi @ppraca As I can understand that, you want to sum the top N value as chosen by the user from the disconnected table. If this is the case, you have to integrate selected value of TopN to your sum measure. Create sum measure to solve the problem :


SumConsumo =
VAR TopN_Value = SelectedValue(TopN[TopN_Value])

VAR _Result = Sumx(TOPN(TopN_Value, YourTable, [Value]), [Value])

Return
_Result



This measure will first select top N value as chosen by the user from the disconnected table, and then sum up the corresponding values. Please adjust the table and column names accordingly.


Hope this helps!!

If this solved your problem, please mark it as a solution!!

bhanu_gautam
Super User
Super User

@ppraca ,You might need to use the CALCULATE function to modify the filter context explicitly. 

 

     TopN_Value = CALCULATE(SELECTEDVALUE('topN'[TopN value]))



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks for your answer, but doesn't work.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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