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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DataUser
Helper I
Helper I

How to What-If with a Sharepoint Online List as Data Source OR Add values based on Slicer Dates

2021-03-26_8-09-14.png

Got a problem - Looking for a solution that will work if my table "AmountSharepointList" is coming from a SharepointOnline List and is not a manual/formulaic table. Tried a Calculated Column, but that wont work cause it needs to be dynamic. I have a what-if value (created off a What-If Parameter) and dates based off of a formulaic table created as Table:

Date = CALENDAR(DATE(2021,1,1),DATE(2021,12,31)

 

I have two possible routes & I dont care which one I use as long as one works!

FIRST: The "What-If  Measure" in my picture ALMOST works, but it applys the what-if amount to every day instead of only those dates on the slicer. Any suggestions to make this formula work so it applies it only to the dates in the the What If dates Slicer? 

 

WhatifMeasure = IF(

MAX('Date'[Date].[Date]) in ALLSELECTED(AmountSharepointList[Date].[Date]),

MAX(AmountSharepointList[Amount]) + [What-If Amount Value],

MAX(AmountSharepointList[Amount])

)

 

Another route: This is basically want I want to do but I know this formula won't work for a lot of reasons. I thought a roundabout approach might be to create two measures that state the start/end dates of my slicer and then incorporate those into some kind of formula?

IF (

AmountSharepointList[Date] >=SelectedMin && AmountSharepointList<=SelectedMax,

AmountSharepointList[Amount]+[What-if Amount],

AmountSharepointList[Amount]

)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DataUser , Second one seems like column not measure and column can not take slicer values

 

You can have measure like

 

measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
IF(

MAX(AmountSharepointList[Date]) >=_min && MAX(AmountSharepointList[Date]) <=_max,

MAX(AmountSharepointList[Amount]) + [What-If Amount Value],

MAX(AmountSharepointList[Amount])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
DataUser
Helper I
Helper I

Thank you! I had to adjust it a tiny bit because for some reason the <= didn't pick up the equal sign on the Var _max, but, amazing. Thanks!

amitchandak
Super User
Super User

@DataUser , Second one seems like column not measure and column can not take slicer values

 

You can have measure like

 

measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
IF(

MAX(AmountSharepointList[Date]) >=_min && MAX(AmountSharepointList[Date]) <=_max,

MAX(AmountSharepointList[Amount]) + [What-If Amount Value],

MAX(AmountSharepointList[Amount])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.