cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oksana Frequent Visitor
Frequent Visitor

Dynamic calculate Measure value based on Slicer Selection

Hi everyone! 

 

I hope, that you can help me, because I'm new in power bi world))))

 

I need to create a table, where I can add measures by choosing atributes in slicer and compare theese measure, for example YoY (see pic below - "Volume" is chosen by filter in slicer) .

Capture.PNG

 

 

 

 

 

 

 

 

I managed to create table based on dynamically calsulated measures and slicer selection (the example is described here - https://community.powerbi.com/t5/Desktop/Changing-column-graph-displayed-value/m-p/108427/highlight/...).

 

Unfortunately, I'm not succed in comparing measures (YoY %). 

Can someone help me, plese? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Dynamic calculate Measure value based on Slicer Selection

Hi oksana,

 

Slicer can't be used to control columns, I would recommend you to use bookmark instead: https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks.

 

Regards,

Jimmy Tao

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Dynamic calculate Measure value based on Slicer Selection

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

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


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Highlighted
Community Support Team
Community Support Team

Re: Dynamic calculate Measure value based on Slicer Selection

Hi oksana,

 

As a general solution, maybe you can try measure below and check if it can meet your requirement:

 

YoY% =
VAR value_A =
    CALCULATE ( MAX ( table[value] ), FILTER ( table, table[year] = 2017 ) )
VAR value_B =
    CALCULATE ( MAX ( table[value] ), FILTER ( table, table[year] = 2018 ) )
RETURN
    CALCULATE ( ( value_B - value_A ) / value_A, ALLSELECTED ( table[Product] ) )

In addtion, if you have other issues, could you share some sample data and share more details about your logic and expected results?

 

Regards,

Jimmy Tao

oksana Frequent Visitor
Frequent Visitor

Re: Dynamic calculate Measure value based on Slicer Selection

 

@v-yuta-msft and @Greg_Deckler,

 

thank you very much for you advices! I will use them for sure.

 

But unfortunately, I can not solve my task

I have attached more details, hoping on  your help 🙂filters.png

 

I have table with columns Product, NetSales, Volume and Year. I need filters,that will help User to choose what type of measure he wants to see in table/chart. I managed to do filters, but I do not know how to make filter, pushing on which (it will appear new column) i can see comparisson of two years in percentage (YoY).

 

Do you have any idea?

 

 

 

 

Community Support Team
Community Support Team

Re: Dynamic calculate Measure value based on Slicer Selection

Hi oksana,

 

Slicer can't be used to control columns, I would recommend you to use bookmark instead: https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks.

 

Regards,

Jimmy Tao

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 329 members 3,209 guests
Please welcome our newest community members: