I need help to subtract amount based on discount criteria as:
Total visitor : 1-100 = take out 30% out of Revenue
Total Visitor in range 100-200 = take out 50% out of Revenue
And so on.
How to use 3 different conditions in one measure DAX.
Go to Solution.
You can try to this way,
Create a discount fact table
Add a column that to judge how much discount will apply for current row
discount = CALCULATE(MAX(Discount[discount]),FILTER(Discount,Table1[Total Visitor]>Discount[start]&&Table1[Total Visitor]<=Discount[end]))
Note: MAX(Discount[discount]) is to prevent there two or more rows with the same start column and end column.
add result column
Result = IF(ISBLANK(Table1[discount]),Table1[Revenue ],Table1[Revenue ]*(1-Table1[discount]))
here is pbix, please try it.
View solution in original post
@malshaikh7 Please try this..
VAR _discount = IF(VisitorRevenue[Total Visitor] <= 100, VisitorRevenue[Revenue] - VisitorRevenue[Revenue]*0.3,
IF(VisitorRevenue[Total Visitor] <=200, VisitorRevenue[Revenue] - VisitorRevenue[Revenue]*0.5,VisitorRevenue[Revenue]))
Note - I've used only two conditions as you mentioned 30% and 50% criteria, for anything else it will return same as Revenue (without any discount)
Proud to be a Super User!
Is there anyway else to change the percent discount instead of edit measure every time I want to change the discount % number.
Check out the News & Announcements to learn more.
Click here to read more about the October 2021 Release!
Check out the new Power Platform Community Connections gallery!
Mark your calendars and join us for our next Power BI Dev Camp!