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

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 @kidsburnedonkey ,

 

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.

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

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

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors