cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jansdc
New Member

Applying aggregated card value into the table

Hi everyone,

I struggle with the problem.

I need to apply calcultion of this card to a table below. Every row should get the same value as from card.
Somehow It's not working, there is still applying context to each row.
my measures:

YTD Average Delay = TOTALYTD(AVERAGE('Table1'[Delayed Days]),'Date Created'[Date])
MEASURE 1 = CALCULATE([YTD Average Delay], ALL('Table1'[RowNumber]))

MEASURE 2 = 28 - Dummy measure just to demo - this is what I want to achieve, card YTD value the same in each row.

jansdc_0-1633999190853.png

 

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

Hi @jansdc ,

 

Try this measure

YTD Average Delay =
CALCULATE (
    TOTALYTD ( AVERAGE ( 'Table1'[Delayed Days] ), 'Date Created'[Date] ),
    ALLSELECTED ( 'Table1' )
)

 

The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

 

Best Regards,

Stephen Tao

 

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-stephen-msft
Community Support
Community Support

Hi @jansdc ,

 

Try this measure

YTD Average Delay =
CALCULATE (
    TOTALYTD ( AVERAGE ( 'Table1'[Delayed Days] ), 'Date Created'[Date] ),
    ALLSELECTED ( 'Table1' )
)

 

The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

 

Best Regards,

Stephen Tao

 

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

VahidDM
Community Champion
Community Champion

Hi @jansdc 

 

try this:

YTD Average Delay = calculate(TOTALYTD(AVERAGE('Table1'[Delayed Days]),'Date Created'[Date]),REMOVEFILTERS([Customer Country]))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors