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
Caldasls15_
Regular Visitor

CREATE SUMMARY MEASURE FROM A TABLE ALSO USING AVERAGE

I have the following table:

 

table.png

I need a measure that can do the following circumstances:

 

1 - First I need to calculate the average monthly sales per user as shown in the following picture. Dividing the total revenue for n months that the specified user had revenue. Except that I need that also considering supplier ID

Note:

- Revenue is the sum aggregation for the REVENUE column.

circ1.png

 

 

2 - I need the same calculation as the previous circumstance but now only considering supplier (an AllExcept should do this part).

circ2.png

 

 

3 - The final result should be as shown in the following picture:

circ3.png

 

The "USER_RESULT" would be the result of the n.1 circumstance, and the "SUPLIER_RESULT" would be the n.2.

 

 

I know that by using AVERAGE and SUMMARY one can probably do this very easily, but I haven't found a way to solve this problem yet.

 

How can I create a measure to display the final result?

 

 

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

Hi @Caldasls15_ ,

You can create a measure to get the average revenue based on the supplier, then drag the fields USER,SUPPLIER_ID,REVENUE and new created measure onto Table visual just like below screen shot.

SUPPLIER_RESULT = 
VAR countofSMonth =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[MONTH] ),
        ALLEXCEPT ( 'Table', 'Table'[SUPPLIER_ID] )
    )
VAR RevenueofpSupplier =
    CALCULATE (
        SUM ( 'Table'[REVENUE] ),
        ALLEXCEPT ( 'Table', 'Table'[SUPPLIER_ID] )
    )
RETURN
    DIVIDE ( RevenueofpSupplier, countofSMonth )

CREATE SUMMARY MEASURE FROM A TABLE ALSO USING AVERAG.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Caldasls15_ ,

You can create a measure to get the average revenue based on the supplier, then drag the fields USER,SUPPLIER_ID,REVENUE and new created measure onto Table visual just like below screen shot.

SUPPLIER_RESULT = 
VAR countofSMonth =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[MONTH] ),
        ALLEXCEPT ( 'Table', 'Table'[SUPPLIER_ID] )
    )
VAR RevenueofpSupplier =
    CALCULATE (
        SUM ( 'Table'[REVENUE] ),
        ALLEXCEPT ( 'Table', 'Table'[SUPPLIER_ID] )
    )
RETURN
    DIVIDE ( RevenueofpSupplier, countofSMonth )

CREATE SUMMARY MEASURE FROM A TABLE ALSO USING AVERAG.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey, 

 

Still on this subject, what measure can I do if I want a column to show the total of the "SUPPLIER_RESULT" repeatedly in each row? 

 

I thought of a ALL_SELECTED but since it's a measure, I can't reference it.

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.

Top Solution Authors