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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
enzo2011
Frequent Visitor

Measure to calculate % for a selected slicer

Hi everyone!

 

So my question is about how to create a measure that calculates the percentage of revenue respect the total revenue of the year selected. Here is an example of the data:

Capture.PNG

 

 

OK so I have 4 different slicers. One for each category and year. So what I want to show is the % of the revenue respect the year/years selected in the revenue. For example: if I filter for 2018, the total is €105. So if afterwards I filter by category I want to see the % of the categories I selected respect the total of 2018. 

 

The result will be to show a card with the percentage of 2018 (if I select 2018 in the slicer):

 

100% if only 2018 is selected

57.14% if 2018 and A7 is selected

100% if 2017 and 2018 is selected

27.27% if 2017/2018/B4 is selected

And so on...

 

The objective it to show the % of the revenue respect the year/s selected.

 

Sorry if I didn't explain myself very well...

 

If you have any doubt with the context I'll be very pleased to help you.

 

Thank you so much in advance!

 

Enzo

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You want to use CALCULATETABLE. CALCULATETABLE allows you to feed it filters and only those filters are modified from the original context. You can see how this works in my Time Intelligence The Hard Way Quick Measure here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

You want to use CALCULATETABLE. CALCULATETABLE allows you to feed it filters and only those filters are modified from the original context. You can see how this works in my Time Intelligence The Hard Way Quick Measure here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you so much Greg!

 

Your post was very helpful. Finally, I solved my problem.

 

Best regards,

 

Enzo

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.