I am an intern at Retail chain and this is my second project and really need your help!
In my powerBI, there are two tables with no direct relationship.
The first table is called retailers: with the following column:
Retailer
Amazon
Walmart
HD
Target
The Second table is called Sale Price: with the following Columns:
Item
Price
ABC1
6
ABC2
17
ABC3
8
ABC4
17
ABC5
15
ABC6
14
ABC7
16
ABC8
19
ABC9
25
The BI will have a slicer with the selection of the retailers. And depend on which selection then it will apply the discount on the sale price.
I created two new measures on the Sale Price table as below.
1st measure:
Margin = SWITCH(
SELECTEDVALUE(āDiscountā[Retailer]),
āAmazonā, 0.40,
āHDā, 0.45,
āTargetā, 0.50,
āWalmartā, 0.55,
BLANK())
2nd measure:
Discount = āSale Priceā[Price]*āSale Priceā[Margin]
However, my Discount column is coming back with blank with no value.
Could anyone please advise what i am missing?
Thank you for your help! Sale Discount.pbix (31.7 KB)
I see a few issues with your approach here.
You are trying to create a calculated column based on the slicer.
and there is no relationship between the two tables
Following is the solution. I have created for you.
I have created 2 new tables.
Retailers this is just the names of the retailers
New Sales this is a table I have created as a cross join between your original sales price and discount tables
I have created a relationship between the two tables.
Followed by two measures. discount applicable and Net Price
Thank you for getting back to me!
How can I apply a logic to when only the user select the retailer in the slicer then the discount will apply. If they dont select anything then the discount will be at $0.