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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Select the sum column based on the filter value in another table.

hi, this is my scenario:

 

table: FilterValue

FilterValue = {"Sales","Profits"}
 
Table: Values
M=
var _v= IF(HASONEFILTER(FilterValue[Value]),
SWITCH(SELECTEDVALUE(FilterValue[Value]),
"Sales", Values[SumSales],
"Profits", Values[SumProfits]
),
BLANK()
)
return _v
 
but the formula returns blank always. The two tables has not relations
1 ACCEPTED SOLUTION
Anonymous
Not applicable

thanks amitchandak

I Solve creating a new column with one value of the filter, later, add the relations to this column. Without the relationship, the filter don't work

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

thanks amitchandak

I Solve creating a new column with one value of the filter, later, add the relations to this column. Without the relationship, the filter don't work

amitchandak
Super User
Super User

@Anonymous , This seem fine

Try line

SWITCH(SELECTEDVALUE(FilterValue[Value],"Sales"),
"Sales", Values[SumSales],
"Profits", Values[SumProfits]
)
 
My advice would be to explore field parameters
Field Parameters- One solution for Measure Dimension slicer: https://youtu.be/lqF3Wa1FllE?t=70
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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