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.
Hey all,
Working through a few different querries on a single table visual. This is preventing slowness in the table. Please provide suggestions on how to make the following a little faster.
Solved! Go to Solution.
Hi @arobinson
Total % =
VAR _selvalue =
SELECTEDVALUE ( 'Credentialing Name Sheet'[Territory Type] )
VAR productivityTotal_ = [Productivity Total]
VAR communicationTotal_ = [Communication Total]
RETURN
SWITCH (
TRUE (),
_selvalue = "D1"
|| _selvalue = "D2"
|| _selvalue = "D3",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "DG1",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "DG2",
( communicationTotal_ * .7 ) + ( productivityTotal_ * .3 ),
_selvalue = "DG3",
( communicationTotal_ * .95 ) + ( productivityTotal_ * .05 ),
_selvalue = "A1", productivityTotal_,
_selvalue = "A2", productivityTotal_,
_selvalue = "A3",
( communicationTotal_ * .05 ) + ( productivityTotal_ * .95 ),
_selvalue = "O1", communicationTotal_,
_selvalue = "O2",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "O3", productivityTotal_,
_selvalue = "NR1",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Note you are invoking the measures many times. By using variables you can have the measures executed just once. You haven't posted the code for [Productivity Total]. Perhaps that can be optimized as well. I don't see much room for performance improvement in [Communication Total], given its simplicity. You can though use IN as a way to make the code more legible and more convenient to create. For instance:
_selvalue IN {"D1", "D2", "D3"}
is equivalent to
_selvalue = "D1"
|| _selvalue = "D2"
|| _selvalue = "D3"
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Note you are invoking the measures many times. By using variables you can have the measures executed just once. You haven't posted the code for [Productivity Total]. Perhaps that can be optimized as well. I don't see much room for performance improvement in [Communication Total], given its simplicity. You can though use IN as a way to make the code more legible and more convenient to create. For instance:
_selvalue IN {"D1", "D2", "D3"}
is equivalent to
_selvalue = "D1"
|| _selvalue = "D2"
|| _selvalue = "D3"
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @arobinson
Total % =
VAR _selvalue =
SELECTEDVALUE ( 'Credentialing Name Sheet'[Territory Type] )
VAR productivityTotal_ = [Productivity Total]
VAR communicationTotal_ = [Communication Total]
RETURN
SWITCH (
TRUE (),
_selvalue = "D1"
|| _selvalue = "D2"
|| _selvalue = "D3",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "DG1",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "DG2",
( communicationTotal_ * .7 ) + ( productivityTotal_ * .3 ),
_selvalue = "DG3",
( communicationTotal_ * .95 ) + ( productivityTotal_ * .05 ),
_selvalue = "A1", productivityTotal_,
_selvalue = "A2", productivityTotal_,
_selvalue = "A3",
( communicationTotal_ * .05 ) + ( productivityTotal_ * .95 ),
_selvalue = "O1", communicationTotal_,
_selvalue = "O2",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 ),
_selvalue = "O3", productivityTotal_,
_selvalue = "NR1",
( communicationTotal_ * .4 ) + ( productivityTotal_ * .6 )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |