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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
djbuncle
Helper I
Helper I

Roll-up calculations that use SELECTEDVALUE

Hi. I have a situation where I can't aggregate/rollup a calculation as the values I'm calculating require the context of a campaign at the more granular level.

E.g. The top pivot shows the [Deposit Value 3d] calculation working using the [Campaign Date] to then sum the deposits over a 3 day range thereafter.

CampaignRollup.png

However in the 2nd pivot where the [Campaign Id] and [Campaign Date] attributes are removed, the [Deposit Value 3d] value returns blank as I suspect it doesn't understand the context of the date range it needs to calculate the deposits over. Obviously I would like this to be the sum of all the campaigns. Below is the calculation I currently use.

 

Deposit Value 3d:=

  VAR StartDate = SELECTEDVALUE('Campaign'[Campaign Date])

  VAR EndDate = SELECTEDVALUE('Campaign'[Post Campaign Marker End])

  RETURN CALCULATE([Deposit Value], FILTER('Activity Date', 'Activity Date'[Activity Date] >= StartDate && 'Activity Date'[Activity Date] <= EndDate))

 

Is there a way I can achieve this?

Thanks.

0 REPLIES 0

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors