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
thbaero
Frequent Visitor

Inserting values from one table to another table based on the selection of slicers

Hi all,

 

I have one table that contains values that I calculate every week.

Basis ist a long list of partnumbers per Team where every part is categorized by "BaseType".

I summarize this list every week and get the count of values for "I", for "I"+"N" and for "I"+"N"+"V"

 

table: I_N_V_Values

ExportDateSE-TeamTeamBaseTypeBaseDateBaseValue
13.04.2020SE-Team 4590I14.01.201913
13.04.2020SE-Team 4590IN08.04.201968
13.04.2020SE-Team 4590INV25.05.202098
06.04.2020SE-Team 4590I14.01.201913
06.04.2020SE-Team 4590IN08.04.201967
06.04.2020SE-Team 4590INV25.05.202099
...     
19.11.2018SE-Team 4590I14.01.201913
19.11.2018SE-Team 4590IN08.04.201922
19.11.2018SE-Team 4590INV25.05.202025
...     
...SE Team 4591.........
...SE Team 1123.........

 

I also have another list with a timeseries starting from 19.11.2018 until 29.06.2020 with an interval of 7 days.

Whenever there is a date that fits to one of the dates from "I", "IN" or "INV" I already list that information in the table.

 

table:BurnUpCurve

DateBaseType
19.11.2018 
26.11.2018 
... 
14.01.2019I
... 
08.04.2019IN
... 
25.05.2020INV

 

I also have three slicers to select an specific "ExportDate", "SE-Team" and "Team".

 

Based on the data of table: I_N_V_Values and the selection of the slicers I want to add columns to table: BurnUpCurve.

 

e.g. Slicers are:

 

ExportDate = 13.04.2020

SE Team = SE Team 4

Team = 590

 

table:BurnUpCurve

DateBaseTypeBaseValue
19.11.2018  
26.11.2018  
...  
14.01.2019I13
...  
08.04.2019IN68
...  
25.05.2020INV98

 

Later I will add another column to the tabel "BurnUpCurve" where I am going to interpolate the values inbetween to get all datapoints for a line graph.

 

I already looked through a lot of solutions that were able to get the value of a slicer and to use it in DAX for further calcuations.

 

However, I was not able to use the value of a slice as an input to filter for the right value in table:I_N_V_Values

 

I tried for example:

 

BaseValue = 
    var Select_Slicer = SELECTEDVALUE(dimDate[Value].[Date])
RETURN
    SUMX(filter('I_N_V_Values';'I_N_V_Values'[BaseType] = BurnUpCurve[BaseType] && 'I_N_V_Values'[ExportDate] = Select_Slicer);'I_N_V-Value'[BaseValue])

 

 

However the formula above didn't work.

 

I'd be really happy if somebody could point me towards a solution for my problem.

 

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @thbaero ,

 

Sorry for that but the calculated columns are computed during the database processing and then stored in the model. So In your scenario, we cannot make the calculated column dynamically.

 

We can create a measure and the relationship between tables to meet your requirement.

1. Create relationships between your tables,

 

1 inserting.jpg

 

inserting2.jpg

 

2. Then create a simple measure like this,

 

BaseValue = CALCULATE(SUM(I_N_V_Values[BaseValue]))

 

3. And use I_N_V_Values[BaseDate], BurnUpCurve[BaseType] and [BaseValue] measure to create a table visual. We can get the result like this,

 

inserting3.jpginserting4.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

 

BTW, pbix as attached.

 

Best regards,


Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @_ zhenbw

 

thank you for the quick reply. But currently I am in the middle of a huge "chaos" in my head.

Still trying to figure out the logic behind some of the DAX concepts (and going through the guided learning for that matter).

 

I already moved on a little bit on in my train of thoughts.

I will still need some time to really think about my problem in order to be able to describe it.

 

Enclosed you can also find a set of data I sampled and anonymized from the real data.

https://drive.google.com/open?id=1PNiHrgyjOQgh3J0KXhO7uVSERILLyo5M

 

Basically I am having a set of data from a database that is exported once a week (ExportDate)

The data is a list of elements which are categorized by

  • Team (Team 1, Team 2, ...., )
  • BaseName (I, N, V)
  • ElementStatus (open, in progress, done)

For the BaseNames there is a second table that holds specifc dates for each distinct BaseName

Base NameWeek
Start44/2019
I51/2019
N09/2020
V22/2020
End27/2020

 

(Actually those dates are the Mondays of each week but the picture below only shows the weeks)

 

 

I want to generate a combined stacked column and line chart from this data:

  1. The stacked column chart should show count of elements grouped by ElementStatus over time (ie ExportDates)
  2. The line graph should display the cumulative amount of elements on a specific ExportDate (selected by a slicer) matched to the specific date of the BaseName.
  3. I want to be able to select a team on a slicer and get the data for that team.
    If I don't select a team than the cumulative Sums over all teams should be displayed.

 

bild.png

 

 

Many thanks for the help!

 

Please be aware that I am currently using MS Power BI (September 2019) and apparently PBIX-Files from the current version are sometimes not compatible with my version.

 

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.