Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
dokat
Post Prodigy
Post Prodigy

Put slicer selection total to each row

Hi,

 

I have below formula that i use to calculate share. The issue i am having is how can i put slicer selection total as static value to each row like in below example (Total Sales column). Appreciate any help!

 

 

Region Fixed State Sales = CALCULATE(Calculate(SUM('Region'[Values]),'POS CY'[Slicer] IN {"L52W"},ALL(Region[Category],Region[Brand],Region[Manufacturer])))

 

 

For Ex: 

 SalesTotal SalesShare
North103603%
South203606%
East303608%
West4036011%
Notheast5036014%
Northwest6036017%
Southeast7036019%
Southwest8036022%
Total360  

dokat_0-1646883274307.png

 

3 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

@dokat 

Is this what you are looking for?

Region Category Fixed = CALCULATE([Region Category Selected], ALLSELECTED(Region[Census Division]))

jdbuchanan71_0-1646890049887.png

 

View solution in original post

parry2k
Super User
Super User

@dokat if yes then this is your measure

 

Region Category Fixed = CALCULATE([Region Category Selected],ALLSELECTED ( Region) ) 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

View solution in original post

parry2k
Super User
Super User

@dokat this should fix it:

 

Region Category Selected = 
CALCULATE(
    SUM ( Region[Values] ),
    'POS CY'[Slicer] IN {"L52W"},
    CROSSFILTER (
        POS[unique],
        Bridge[Unique],
        BOTH
    )
)

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

View solution in original post

22 REPLIES 22
parry2k
Super User
Super User

@dokat  Thanks for the feedback. If you haven't already, do subscribe to my YT channel. I'm posting almost a video every day since Jan 1st and most of these videos are inspired by real-time problems and/or questions posted on the Power BI Community forum. Cheers!!



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
Super User
Super User

@dokat I have a video on this function on my YT channel, check it out here. https://youtu.be/XXVRwvni4Ms



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 Video was very helpful and educational.

@parry2k I will check it out. 

parry2k
Super User
Super User

@dokat this should fix it:

 

Region Category Selected = 
CALCULATE(
    SUM ( Region[Values] ),
    'POS CY'[Slicer] IN {"L52W"},
    CROSSFILTER (
        POS[unique],
        Bridge[Unique],
        BOTH
    )
)

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

Please disregard my quetsion from last night as changing (Region) to Map fixed my issue. Thanks for all your help

@parry2k Thank you! It worked. I never used crossfilter function before i need to study.

jdbuchanan71
Super User
Super User

@dokat 

@parry2k is correct, my measure would not work if you put any other field from the Region table on the rows.  You should do it like this instead.

Region Category Fixed = CALCULATE([Region Category Selected], ALLSELECTED(Region))

@jdbuchanan71 @parry2k I updated the formula with ALLSELECTED(Region). Thanks!

parry2k
Super User
Super User

@dokat @jdbuchanan71 measure will work but if you use any other column in the visualization from the Region table, it will not work. Good luck!

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

@jdbuchanan71 @parry2k I have one more question related to this issue and the file i shared.

 

When select all is selected in category slicer 'region Category Selected" returns $983,389,587.89 however it should return $2,535,250,045.49. What may cause this issue? Appreciate any help.

 

parry2k
Super User
Super User

@dokat if yes then this is your measure

 

Region Category Fixed = CALCULATE([Region Category Selected],ALLSELECTED ( Region) ) 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



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.

jdbuchanan71
Super User
Super User

@dokat 

Is this what you are looking for?

Region Category Fixed = CALCULATE([Region Category Selected], ALLSELECTED(Region[Census Division]))

jdbuchanan71_0-1646890049887.png

 

@jdbuchanan71 Thank you, this is exactly what i was looking for.

parry2k
Super User
Super User

@dokat is this what you are looking for?

 

parry2k_0-1646890046929.png

 



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 Yes i do. @jdbuchanan71 solution worked. Thank you boh for looking into this

parry2k
Super User
Super User

@dokat anytime you ask a question, you have to share your data model, how tables are connected and from which table you are using what columns? Simply sharing the screen shot will not help to answer the question. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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 I uploaded the sample file to dropbox. Please see below link, hope this helps.

 

https://www.dropbox.com/s/6fuhafrvn5j4fau/Test%20Data.pbix?dl=0

parry2k
Super User
Super User

@dokat did you test what I provided? What is the result you are getting?



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 Yes i did test your formula. Logic makes sense however its returning wrong values. It makes me wonder whether it is due to a link table.

Please see below screenshot. I'd like each row under "Region Category Fixed" column to show $55,108,306.86. all() function result total of the entire column. I'd like total of only selected value in slicer. Hope this clarifies. Is there anyway to do this?

 

dokat_0-1646888626955.png

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors