Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

How to multiply percentages in different table with no primary key

Hello!

 

I have a sales data for which I am trying to use just the last 5 years data for any selected year. For this, I have taken Year & Sales . I have a slicer which is not linked to this table and is used to select the particular year.

Now, for this specific set of last 5 years data after selecting the Year from slicer, I need to multiply the sales with specific percentages.

I created a separate tabel with columns as Year Considered and Percentage. I want to multiply each row of the specific data from sales table to the percentage mentioned in another. But when I try to drop the Percentage in the table, it doesn't give me right answer, probably because it doesn't have a primary key. Any solution to this? Following is a snapshot of 2 tables and what I am looking for. 

 

Sales Table with selected Year from slicer as 2021 which shows values for last 5 years:

kamsingh11_0-1644013205683.png

 

Separate table with Percentage below:

kamsingh11_1-1644013244166.png

The output I am looking for is as follows where I want to see Percentage which finally I want to multiply with sales to get a new number. But when I drop Percentage in this table to cross-check before multiplying, I get same number in each row.

kamsingh11_3-1644013395191.png

 

 

Anyway to do this? 

Thanksin advance!

3 REPLIES 3
lbendlin
Super User
Super User

You show an output that is not consistent with your text. It is also not clear how you link your "Years considered" to the sales facts. Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.

Anonymous
Not applicable

I would like to rephrase this. Hopefullhy, I can explain problem better:

I have a sales table for which I am trying to use just the last 5 years data for any selected year and of course, data changes for selected year. Example as below where selected year is 2021 and it displays data for last 5 years from 2017:

kamsingh11_0-1645069605736.png

and I would like to have percenatges shown below next to this sales data and then create a new column that multiplies sales with percentage. 

kamsingh11_1-1645069737886.png

Percentages will remain the same or constant for these 5 rows. But sales will change based on the selected year. In other words, if selected year was 2022, then sales data will display values for years 2018 - 2022. But the percentages above will still have the same sequence.

Right now, I am struggling to use these constant values next to each row.

 

Any help to resolve this issue would be appreciated. Thanks for your help in advance!

 

Your sample data does not cover the described issue. Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors