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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

 

Much appreciated 🙂

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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