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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eriweste
Helper I
Helper I

SUM number of rows based on filter interval and values from other table

Problem

Visualize the amount of compensations that should be payed to customers based on there consumption in specific months

 

Compensation is based on intervals and are stored in separate table "MasterIntervals"

Ex:

eriweste_1-1642853983712.png

 

 

Consumption, customer and dates are stored in "ReadingTable"

 

eriweste_0-1642853828785.png

 

Based on the interval the customers consumption is related to, thay are entitled to compensation

 

We need to visualize and SUM the total amount of compensation for each "interval"

 

Ex: Based on the Month (filter) "December", 3870 customers (one per row) are in the interval "100"

= 3870 * 100

 

ANy ideas ?

 

Br

erik

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @eriweste 

 

You need to calculate the number of rows then multiply by the corresponding compensation.

Like this:

NUMBER =
CALCULATE (
    DISTINCTCOUNT ( 'ReadingTable'[InstNum] ),
    'ReadingTable'[Month] = SELECTEDVALUE ( 'ReadingTable'[Month] )
)
Total =
[NUMBER] * SELECTEDVALUE ( 'MasterIntervals'[Compensation] )

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @eriweste 

 

You need to calculate the number of rows then multiply by the corresponding compensation.

Like this:

NUMBER =
CALCULATE (
    DISTINCTCOUNT ( 'ReadingTable'[InstNum] ),
    'ReadingTable'[Month] = SELECTEDVALUE ( 'ReadingTable'[Month] )
)
Total =
[NUMBER] * SELECTEDVALUE ( 'MasterIntervals'[Compensation] )

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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