Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I want to create a calculated column by dividing columns from 2 tables linked with each other. It is giving me wrong answer. How to do this. Thanks in advance!
Hi @Anonymous ,
From this:
Only measure is giving the correct value and not the calculated column.
I have put the slicer of Start Time on the report based on which it will calculate max speed.
It seems that the max speed is dynamiclly based on the selected date period in slicer, right?
If so, calculated column is not available since it is static and could not be changed. You have to use measure instead.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@TheoC Thanks for your patience. I am sharing the details.
I don't know how to share the PBIX file with you.
@Anonymous if there's a relationship using the IDs in both tables, then create following calculated columns:
colRelated = RELATED ( [Volume] ) // This brings the Volume column into the other table
colDivision = DIVIDE ( [Volume] , [Time] , 0 ) // This divides Volume by Time.
Hope this helps.
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
@TheoC Thanks for answering. It works but gives wrong values.
Other info- I have two tables related to each other on ID.
Table 1 has columns-Start time, End Time, ID
Table 2 has columns- ID, Volume
Speed = divide volume by Time difference btw start and end time. And then need to further divide by max speed.
Only measure is giving the correct value and not the calculated column.
I have put the slicer of Start Time on the report based on which it will calculate max speed.
@Anonymous What measure are you using?
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
@Anonymous can you provide me with the outputs that you are seeing or provide example data please. Unfortunately, it's very challenging try to understand why a basic measure works as required in this instance but there are complications with the column.
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Anonymous
Can you try this:
Column =
VAR _1 = SUM ( Table1[Amount] )
VAR _2 = SUM ( Table2[Amount] )
VAR _3 = _1 / _2
RETURN
IF ( _3 = 0 , 0 , _3 )
Hope this helps.
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
103 | |
98 | |
98 | |
38 | |
37 |
User | Count |
---|---|
152 | |
120 | |
73 | |
72 | |
63 |