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 everyone,
I am looking for help on how to calculate the measure that would summarize the table results based on the inverse user's slicer selection.
The measure is one of many within the report (the others are based directly on the slicer selections).
Below is an example. My objective is to have the yellow cell contain a result of the calculation for all the company codes different to CH10.
I'd be really grateful for help.
Regards
Krzysztof
Solved! Go to Solution.
@Anonymous my bad it should be
measures =
VAR __CompanyCode = VALUES ( Table[CompanyCode] )
VAR __selectedCompanyCode = SELECTEDVALUE ( Table[CompanyCode] )
RETURN
CALCULATE(
SUM ( Table[Active] ),
ALL ( Table[CompanyCode] ) ,
IF ( __selectedCompanyCode == BLANK(), 1 , NOT Table[CompanyCode] IN __CompanyCode )
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Anonymous ,
Would you please first create a calculated table for you company code slicer ?
_slicer = values('Table'[Company Code])
Then use the following measure to get the calculation for all the company codes different to the selected values from slicer.
Measure =
VAR slicer = VALUES('Slicer'[Company Code])
RETURN
CALCCULATE(SUM('Table'[Values]),FILTER(ALL('Table'), NOT('Table'[Company Code] in _slicer)))
Best Regards,
Dedmon Dai
@v-deddai1-msft thanks for your comments.
I tried out your proposed solution but unfortunately get blank as a result of the calculation.
I defined the table as you instructed, including the accurate names it looks like this:
Regards
Krzysztof
@Anonymous did you tried the solution I proposed, you never clarified that if it worked or not.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous try following measure, change column and table name as per your model
measures =
VAR __CompanyCode = VALUES ( Table[CompanyCode] )
VAR __selectedCompanyCode = SELECTEDVALUE ( Table[CompanyCode] )
RETURN
CALCULATE(
SUM ( Table[Active] ),
ALL ( Table[CompanyCode] ) ,
IF ( __selectedCompanyCode == BLANK(), 1 , NOT Table[CompanyCode] IN __room )
)
I would 💖Kudos 🙂 if my solution helped. If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k thank you for help.
I tired it out a moment ago and have a question. What does the '__room' component in the below line refer to ? I assume it must be some calculated table but I haven't defined it. I guess it's a table that dynamically captures slicer's selections. Would you know how to create it ?
IF ( __selectedCompanyCode == BLANK(), 1 , NOT Table[CompanyCode] IN __room )
Regards
Krzysztof
To illustrate it a bit better the measure which I updated with my names looks in a following way:
@Anonymous my bad it should be
measures =
VAR __CompanyCode = VALUES ( Table[CompanyCode] )
VAR __selectedCompanyCode = SELECTEDVALUE ( Table[CompanyCode] )
RETURN
CALCULATE(
SUM ( Table[Active] ),
ALL ( Table[CompanyCode] ) ,
IF ( __selectedCompanyCode == BLANK(), 1 , NOT Table[CompanyCode] IN __CompanyCode )
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous glad it worked out.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |