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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sidnir
Regular Visitor

Multiplication based on a rate table

Hi all,

I'm slightly new to this so I'll try to explain the problem as best as possible.

 

My main table contains call data records for devices. Each row is a single data session.

device ID, total data, date (mm-yyyy)

Another table has a reference to device ID and country. Theres a relationship linking device IDs.

device ID, country, etc.

I created a 3rd table which is a static table that is a simple rate card.

country, rate1, rate2

 

I want to calculate 

Total distinct no. of devices x rate1 for every month.

 

I tried calculate(distinctcount(device ID) * sum(rate1)) which is the only way I can add rate1 in the forumla, but that's incorrect. It sums up the rate for every row containing the same device id from table1.

 

I simply want, for each month, number of devices * rate1.

Rate1 is a per device per month rate.

 

ANy help on this will be appreciated!

 

Thank you.

 

 

 

1 ACCEPTED SOLUTION
aduguid
Super User
Super User

Try this measure 

Total Device Rate1 per Month = 
VAR DistinctDevices = DISTINCTCOUNT('Call Data Table'[device ID])
VAR DeviceCountry = SELECTEDVALUE('Device Reference Table'[country])
VAR Rate1 = LOOKUPVALUE('Rate Card Table'[rate1], 'Rate Card Table'[country], DeviceCountry)

RETURN 
DistinctDevices * Rate1

View solution in original post

3 REPLIES 3
aduguid
Super User
Super User

Try this measure 

Total Device Rate1 per Month = 
VAR DistinctDevices = DISTINCTCOUNT('Call Data Table'[device ID])
VAR DeviceCountry = SELECTEDVALUE('Device Reference Table'[country])
VAR Rate1 = LOOKUPVALUE('Rate Card Table'[rate1], 'Rate Card Table'[country], DeviceCountry)

RETURN 
DistinctDevices * Rate1

Awesome! Thank you for the quick response!

This worked perfectly!

Thank you so much!! 😊

Ritaf1983
Super User
Super User

Hi @sidnir 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors