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
Anonymous
Not applicable

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

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
Anonymous
Not applicable

 

@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?

 

 

 

 

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

v-yuta-msft
Community Support
Community Support

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

Greg_Deckler
Super User
Super User

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...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.