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
Freforio
Frequent Visitor

Total not showing in table views for average measure

Hello, 

 

I'm at my wits end with this issue. I'm struggling to make it so the total of the table is printed. I believe the issue is with the context of the total but I'm not sure how to solve it.

I have the following table:

Freforio_1-1662036623596.png

 

Here is the breakdown of the columns:


Date
comes from a Calendar


Meas_FTDS
is a measure calculated this way:

CALCULATE(
SUMX(Fact_Earnings,Fact_Earnings[ftds]),
filter(Fact_Earnings,Fact_Earnings[Incomplete extract]=0))
Just a sumx of the ftds column and filtered so it does not return any incomplete extract.
 
FC_FTD 13M MA
 
VAR
    FTD1mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -1, MONTH ) )
VAR
    FTD2mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -2, MONTH ) )
VAR
    FTD3mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -3, MONTH ) )
VAR
    FTD4mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -4, MONTH ) )
VAR
    FTD5mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -5, MONTH ) )
VAR
    FTD6mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -6, MONTH ) )
VAR
    FTD7mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -7, MONTH ) )
VAR
    FTD8mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -8, MONTH ) )
VAR
    FTD9mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -9, MONTH ) )
VAR
    FTD10mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -10, MONTH ) )
VAR
    FTD11mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -11, MONTH ) )
VAR
    FTD12mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -12, MONTH ) )
VAR
    FTD13mAgo = CALCULATE([Meas_FTDS],dateadd(_Calendar[Date], -13, MONTH ) )
VAR
    MA = CALCULATE(DIVIDE( FTD1mAgo + FTD2mAgo + FTD3mAgo + FTD4mAgo + FTD5mAgo + FTD6mAgo + FTD7mAgo + FTD8mAgo + FTD9mAgo + FTD10mAgo + FTD11mAgo + FTD12mAgo+ FTD13mAgo, 13,0))
VAR
    OnlyFC = IF(ISBLANK([Meas_FTDS]),
    CALCULATE(MA, SAMEPERIODLASTYEAR(_Calendar[Date])),
    BLANK())
RETURN
    OnlyFC
When I Return the variable MA I get the total amount but I want to filter so this column only returns values at the total or on days I don't have a figure in column Meas_FTDS That way I can get both in a single measure later.
 
I would greatly appreciate any help.
 

 

1 ACCEPTED SOLUTION

@Freforio 

You can use a new measure 

FC_FTD 13M MA 2 =
SUMX ( VALUES ( _Calendar[Date] ), [FC_FTD 13M MA] )

View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

@Freforio 

Do you want to return the average of the visible values or the sum of the visible values?

Hello, the sum of visible values.

@Freforio 

You can use a new measure 

FC_FTD 13M MA 2 =
SUMX ( VALUES ( _Calendar[Date] ), [FC_FTD 13M MA] )

Thanks a lot! I guess the new measure gets a different context than any carried over from the variables? 

@Freforio 
Exactly

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