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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Sanmaya
Frequent Visitor

Need help to fix the DAV formula, which is producing Blank value

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"),

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

 

 

Sahir_Maharaj
Super User
Super User

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"
    )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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