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.
hi All,
I like to know the difference between
switch( selectedvalue('table'[game])
.... some conditons....
)
vs
switch( 'table'[game]
.... some conditions...
)
what's the difference in using selectedvalue & not using selectedvalue?
Solved! Go to Solution.
In Power BI, the SELECTEDVALUE function and referencing a column directly can serve different purposes, and understanding when to use each depends on your specific requirements and the context of your calculations. Let's break down the differences between the two:
Using SELECTEDVALUE:
Example:
Measure =
SWITCH(
SELECTEDVALUE('table'[game]),
"Game A", ...,
"Game B", ...,
"Game C", ...
)
Referencing the Column Directly:
Example:
Measure =
SWITCH(
'table'[game],
"Game A", ...,
"Game B", ...,
"Game C", ...
)
In summary, the key difference is that SELECTEDVALUE is used to consider the current user-selected value in a slicer or filter context, while referencing the column directly ('table'[game]) ignores the context and works with all values in the column. The choice between the two depends on your specific calculation requirements and whether you need to consider user selections in your calculations.
In Power BI, the SELECTEDVALUE function and referencing a column directly can serve different purposes, and understanding when to use each depends on your specific requirements and the context of your calculations. Let's break down the differences between the two:
Using SELECTEDVALUE:
Example:
Measure =
SWITCH(
SELECTEDVALUE('table'[game]),
"Game A", ...,
"Game B", ...,
"Game C", ...
)
Referencing the Column Directly:
Example:
Measure =
SWITCH(
'table'[game],
"Game A", ...,
"Game B", ...,
"Game C", ...
)
In summary, the key difference is that SELECTEDVALUE is used to consider the current user-selected value in a slicer or filter context, while referencing the column directly ('table'[game]) ignores the context and works with all values in the column. The choice between the two depends on your specific calculation requirements and whether you need to consider user selections in your calculations.
Thanks for the reply
it was helpful
can you help me with the below one too?
https://community.fabric.microsoft.com/t5/Desktop/count-of-columns/m-p/3679253
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
95 | |
94 | |
79 | |
71 | |
64 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |