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
Syndicate_Admin
Administrator
Administrator

Calculate average commercial income (amount) per month in a dynamic way

Nice day
Friends request your support for the following: I need to calculate the average of commercial income (amount) per month in a dynamic way, that is, that when selecting the table or graph of bars or ring graph or applied column graph, Show me that total on a card of what he selected. I placed on the card the total of commercial income as a field and I put the option of average and it takes it out badly, that is, if I select 12 months for all accounts, it should be the total of my income divided 12 months, but with the average that is found as an option in the card / fields / average, it adds the number of months for accounts that I have there, that is, a sum of 12 months ago for 11 accounts that I have, which is equal to 132 months and is wrong

This is my table:

image.pngimage.pngimage.pngimage.png

The number of Accounts that exist is 11, each one has its income per month.

This is my card:

rbaltpower_1-1643296433387.png

There you see the total of commercial income that between 12 months should be: 27,102.21 and not the amount shown there of 2,463.84 that is calculated for 132 months that is of each account that is wrong.

I have tried several formulas, but I cannot find the solution:

DIVIDE( SUM('RentaMercantiles'[Commercial Income]) ,DISTINCT(VALUES('RentaMercantiles'[Date].[ Mesno])), 0 )
DIVIDE(SUM('Commercial Revenues'), (DISTINCT(ALL SELECTED) ('Commercial Revenues'[Date].[ Mesno]))),0 )
AVERAGEX(DISTINCT('Commercial Revenues'[Date].[ Month]),SUM('Commercial Revenues'[Commercial Income]))
AVERAGEX(SUM('Commercial Revenues'), DISTINCT('Commercial Income' [Date].[ Month]))

var Descrip = CONCATENATEX(DISTINCT(ALLSELECTED('IngresosMercantiles'[Date].[ Month])),'Commercial Revenue'[Date]. [Month],",")
RETURN
CALCULATE(
AVERAGE(Describe,
'Commercial Revenue' [Date] . [Month] IN {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
}
)

I thank you for any support in this case.

Waiting for a prompt response.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Nice day

I think I have achieved the solution to my problem, and that is:

Average Ing_Merc = AVERAGEX(
KEEPFILTERS(VALUES('Merchant Revenue' [Date].[Monthno])),
CALCULATE(SUM('Commercial Revenues' [Commercial Income])))
greetings my friends...

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Nice day

I think I have achieved the solution to my problem, and that is:

Average Ing_Merc = AVERAGEX(
KEEPFILTERS(VALUES('Merchant Revenue' [Date].[Monthno])),
CALCULATE(SUM('Commercial Revenues' [Commercial Income])))
greetings my friends...

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.