Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi data gurus,
I have an issue that I'm hoping one of you may be able to help with. With the following test data:
Initiating Org | Ending Org | Count |
A | B | 1 |
B | B | 32 |
C | B | 1 |
D | B | 3 |
E | B | 2 |
F | B | 1 |
B | C | 2 |
B | G | 1 |
B | E | 10 |
B | F | 1 |
I have a slicer on "Ending Org" and two measures:
Initiating Org | Ending Org | Count | Measure 1 | Measure 2 | Measure 3 |
A | B | 1 | 1 | ||
B | B | 32 | 32 | ||
C | B | 1 | 1 | 2 | |
D | B | 3 | 3 | ||
E | B | 2 | 2 | 10 | |
F | B | 1 | 1 | 1 | |
B | G | 1 | 1 | ||
41 | 32 | 8 | 14 |
Solved! Go to Solution.
Hi @M_Ulloa ,
Thanks for the detailed explanation and example—this is a classic scenario where context transition in DAX can trip things up, especially when working with slicers and row context in visuals. The issue with your Measure3 returning the same value across all rows stems from the use of SELECTEDVALUE, which doesn't behave as expected when used in a row-level evaluation within a table visual. Instead, you’ll want to leverage the current row context to dynamically reference the “Initiating Org” rather than relying solely on the slicer’s value.
One approach is to use VALUES or directly reference the row context using myTable[Initiating Org] in your measure. Try modifying Measure3 like this:
Measure3 =
CALCULATE(
[Count],
FILTER(
ALL(myTable),
myTable[Initiating Org] = EARLIER(myTable[Initiating Org]) &&
myTable[Ending Org] = SELECTEDVALUE(myTable[Ending Org]) &&
myTable[Initiating Org] <> myTable[Ending Org]
))
Alternatively, consider using a calculated column if you're looking to simplify row-level logic. If EARLIER doesn't quite solve it, using variables to explicitly capture the row-level values might be more reliable in a measure context. Let me know if you'd like help rewriting it that way. You're on the right track, and with a small tweak to respect row context, your visual should display as expected.
Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.
Connect with me on LinkedIn: Rohit Kumar.
Hi @M_Ulloa
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @M_Ulloa
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @M_Ulloa
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @M_Ulloa ,
Thanks for the detailed explanation and example—this is a classic scenario where context transition in DAX can trip things up, especially when working with slicers and row context in visuals. The issue with your Measure3 returning the same value across all rows stems from the use of SELECTEDVALUE, which doesn't behave as expected when used in a row-level evaluation within a table visual. Instead, you’ll want to leverage the current row context to dynamically reference the “Initiating Org” rather than relying solely on the slicer’s value.
One approach is to use VALUES or directly reference the row context using myTable[Initiating Org] in your measure. Try modifying Measure3 like this:
Measure3 =
CALCULATE(
[Count],
FILTER(
ALL(myTable),
myTable[Initiating Org] = EARLIER(myTable[Initiating Org]) &&
myTable[Ending Org] = SELECTEDVALUE(myTable[Ending Org]) &&
myTable[Initiating Org] <> myTable[Ending Org]
))
Alternatively, consider using a calculated column if you're looking to simplify row-level logic. If EARLIER doesn't quite solve it, using variables to explicitly capture the row-level values might be more reliable in a measure context. Let me know if you'd like help rewriting it that way. You're on the right track, and with a small tweak to respect row context, your visual should display as expected.
Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.
Connect with me on LinkedIn: Rohit Kumar.
hello @M_Ulloa
please check if this accomodate your need.
although i am not sure why you have G in your expected result screenshot if the screenshot showed B value in EndingOrg slicer.
also i am not sure the meaning of measure 3. you want to calculate value when InitiatingOrg is equal to EndingOrg and InitiatingOrg is not equal to EndingOrg. Seems conflicting.
Hope this will help.
Thank you.
User | Count |
---|---|
84 | |
82 | |
66 | |
52 | |
46 |
User | Count |
---|---|
100 | |
48 | |
42 | |
39 | |
38 |