Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
Need help in below issue
I have a Table(sendingpro) of data with columns like source, destination, Pre/Post and Value column in it. i have a filters to select source and destination location. the Data in Table are all combination of Source and destination with pre and post values.i need to find the value for Post. my DAX formula is as below
The condition is that for a combination of source and destination the post value if different and i need to find the Post value for Source is destination and destination is source.
Value_Post=Calculate([TotalValue],
FILTER(Sedningpro,Sendingpro[destination]=SELECTEDVALUE(Sendingpro[source])),
FILTER(Sedningpro,Sendingpro[Source]=SELECTEDVALUE(Sendingpro[Destination])),
FILTER(Sedningpro,Sendingpro[Pre/Post]="Post"),
Solved! Go to Solution.
Hi @Sanmaya ,
According to your statement, I will give you some suggestions.
I think your slicer is created by Sendingpro[source] and Sendingpro[Destination] columns which are both in same tables as values. As far as I know, if you select value in these slicer your table will be filtered directly, this will casue your issue.
Here I suggest you to create unrelated dimtables like DimSource and DimDestination to create slicer then use selectedvalue to catch value.
Then please make sure your code is correct, I am confused about Sendingpro[destination]=SELECTEDVALUE(Sendingpro[source]) and Sendingpro[Source]=SELECTEDVALUE(Sendingpro[Destination]).
Whether they should be Sendingpro[destination]=SELECTEDVALUE(Sendingpro[Destination]) and
Sendingpro[Source]=SELECTEDVALUE(Sendingpro[source]).
Value_Post =
CALCULATE (
[TotalValue],
FILTER (
Sendingpro,
Sendingpro[Source] = SELECTEDVALUE ( DimDestination[Destination] )
&& Sendingpro[Destination] = SELECTEDVALUE ( DimSource[Source] )
&& Sendingpro[Pre/Post] = "Post"
)
)
Or
Value_Post =
CALCULATE (
[TotalValue],
FILTER (
Sendingpro,
Sendingpro[Source] = SELECTEDVALUE ( DimSource[Source] )
&& Sendingpro[Destination] = SELECTEDVALUE ( DimDestination[Destination] )
&& Sendingpro[Pre/Post] = "Post"
)
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sanmaya ,
According to your statement, I will give you some suggestions.
I think your slicer is created by Sendingpro[source] and Sendingpro[Destination] columns which are both in same tables as values. As far as I know, if you select value in these slicer your table will be filtered directly, this will casue your issue.
Here I suggest you to create unrelated dimtables like DimSource and DimDestination to create slicer then use selectedvalue to catch value.
Then please make sure your code is correct, I am confused about Sendingpro[destination]=SELECTEDVALUE(Sendingpro[source]) and Sendingpro[Source]=SELECTEDVALUE(Sendingpro[Destination]).
Whether they should be Sendingpro[destination]=SELECTEDVALUE(Sendingpro[Destination]) and
Sendingpro[Source]=SELECTEDVALUE(Sendingpro[source]).
Value_Post =
CALCULATE (
[TotalValue],
FILTER (
Sendingpro,
Sendingpro[Source] = SELECTEDVALUE ( DimDestination[Destination] )
&& Sendingpro[Destination] = SELECTEDVALUE ( DimSource[Source] )
&& Sendingpro[Pre/Post] = "Post"
)
)
Or
Value_Post =
CALCULATE (
[TotalValue],
FILTER (
Sendingpro,
Sendingpro[Source] = SELECTEDVALUE ( DimSource[Source] )
&& Sendingpro[Destination] = SELECTEDVALUE ( DimDestination[Destination] )
&& Sendingpro[Pre/Post] = "Post"
)
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Sanmaya,
Here's an updated version of your DAX formula:
Value_Post =
CALCULATE(
[TotalValue],
FILTER(
Sendingpro,
Sendingpro[Source] = SELECTEDVALUE(Sendingpro[Destination]) &&
Sendingpro[Destination] = SELECTEDVALUE(Sendingpro[Source]) &&
Sendingpro[Pre/Post] = "Post"
)
)