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

Visual interaction with table (selectedvalue).

Hi, Friends.

 

I've breaked my brains with a solution, still can't do a simple calcucation (on first sight).

I have by week chart with volumes (packs), data set has max week 15 and min week 7.

Also I have another visual - table with products: [Product name], [Current Week vol], [Previous week vol].

 

Now comes the hardest. 

What I'm trying to achieve with interactions is - if no bar is selected, then in table week volume for current should be max week available and for previous week its previous one. But when i select a bar (in ex. week 7), then current week should have volume of the 7th and previous week - 6th.

 

I've gone so far to a measure for previous week as :

[Previous week vol] =
CALCULATE(
SUMX(Sales,Sales[packs]),
FILTER(all('Sales') ,Sales[week_num] = SELECTEDVALUE(Sales[week_num])-1))
)
 
Now, how do I do a simple IF close, if selected then show selected week bar values, if non is selected- last week in dataset and later to apply it as a filter as true/false - week_num = week_to_display.
3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive for Business and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

My mistake. Here is sample of my data:

areaSales pointChannelProduct familyProduct nameweek_numbermonth_numberyear_numberVolume packs
CentreCEN122RetailFamily 1Product 11332020440
NorthNOR183WholesaleFamily 1Product 19220201650
NorthNOR088RetailFamily 1Product 11232020550
EastEAS148RetailFamily 1Product 1103202010450
EastEAS251Key AccountFamily 1Product 110320201952.5
EastEAS192RetailFamily 1Product 110320209536.45
SouthSOU022Key AccountFamily 1Product 110320203047
CentreCEN069RetailFamily 1Product 110320201002.1

 

Table in report looks like:

Product IDWeek SelectedPrevious Week
Product 1  
Product 2  
Product n  

 

Thanks in advance.

Greg_Deckler
Super User
Super User

Having a difficult time following this. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


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