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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Top006
Frequent Visitor

Using a parameter in desktop

Hello everyone,

 

Hope someone can assist with my parameter issue which is causing a lot of headache.

 

I have two tables; (A) with three ID's and three products for each, and (B) which a discount at a given qty supplied:

TABLE A
IDProductCost1
AX48
AY50
AZ24
BX25
BY50
BZ45
CX31
CY46
CZ35

 

TABLE B
IDSupplied qtyDiscount
A10-3
A20-8
A30-20
A40-8
A50-15
A60-20
A700
B10-14
B20-17
B30-16
B40-1
B50-7
B60-16
B70-4
C10-6
C20-5
C30-17
C40-14
C50-7
C60-3
C70-18


What I would like to do is to enable the report reader to adjust the supplied qty by using a parameter and then have a calculated table showing the new cost (2) i.e. if supplied qty is set to 10:

Cost2
ID \ ProductXYZ
A454721
B113631
C254029

 

and if set to 50:

Cost2
ID \ ProductXYZ
A33359
B184338
C243928

 

I have created a parameter in Power BI (GENERATESERIES(10; 70; 10)) which can be used to show the discount for each ID according to the given qty in the parameter in a table. However, I can't figure out how to calculate the new cost as shown above.

 

Any ideas please?

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Top006 , You need have common table ID

 

measure =
var _value = selectedvalue(series[value])
return
sum(TableA [Cost]), calculate(Sum(TableB[Discount]), filter(TableB, TableB[ID] = Max(ID[ID]) && TableB[Supplied qty] =_value))

 

Bridge Table https://youtu.be/Bkf35Roman8

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Top006 , You need have common table ID

 

measure =
var _value = selectedvalue(series[value])
return
sum(TableA [Cost]), calculate(Sum(TableB[Discount]), filter(TableB, TableB[ID] = Max(ID[ID]) && TableB[Supplied qty] =_value))

 

Bridge Table https://youtu.be/Bkf35Roman8

Thank you very much @amitchandak !!! This works excatly as intended..

 

Much appreciated 🙂

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors