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
Anonymous
Not applicable

Need a way to add an adjustment to the value for a specific month that is dynamically selected

Hi All,

 

I need some help with values I have in a table called FactVolume which has a volume metric and keys relating back to respective dimension tables. One of those is a Date table which has Month (i.e. "Jan 2020", "Feb 2020", etc). On my report I have a textbox for an adjustment amount and a Date slicer showing months (this has no relationship currently to the other Date table). If a user puts in the value 10000 and selects "Apr 2020" I would like to add the value of 10000 to just the month of April and have the rest of the Volume values in FactVolume be the same (i.e. with no adjustment). If this were on a line chart the bottom axis would be the months and there would be a spike for the month of April. Again this adjustment is selected dynamically so I dont think i can use a Calculated column for this. Any help would be appreciated.

 

Scott

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

Adjusted Project Volume = 
SUMX (
    DISTINCT ( 'Calendar'[Month] ),
    IF (
        [Month] IN FILTERS ( 'AdjustedDate'[Month] ),
        SUM ( 'Table'[ProjectVolume] ) + [Adjustedt Value],
        SUM ( [ProjectVolume] )
    )
)

 

3.jpg4.jpg


Best regards,

 

Community Support Team _ Dong Li
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

5 REPLIES 5
mussaenda
Super User
Super User

Hi @Anonymous ,

 

Kindly provide sample  data and expected result

Anonymous
Not applicable

My table is structured something like this (simplified a bit since I removed some of the other foreign keys - the DateKey is a "smart" key where 20191201 represents Dec 01 2019, 20200101 represents Jan 01 2020, 20200201 represents Feb 01 2020, etc):

DateKey ProjectVolume
20191201 34244781
20200101 30629411
20200201 31884789
20200301 30382500
20200401 28180872
20200501 31221904
20200601 32338541
etc

 

On my report I also have an adjusted textbox and a Date slicer where I can pick the month (this Date slicer is tied to an unrelated Date table to get its Month values):

 

Capture1.JPG

 

I would like to produce a Line chart with Months on the bottom axis plotting the Projected volume with values from the table listed above like this:

Capture2.JPG

For the month in the dropdown I would like to add the Adjusted Volume number to the projected volume for that month. So in this case for April 2020 I would like to see 28,180,872 + (-264,735) or  27,916,137. All of the other values for the other months I would like to remain the same. I have created a measure but I am getting the adjustment added to all months which is not what I want. I am fairly new to DAX so I would welcome any help here. Thanks

 

Scott

Anonymous
Not applicable

I am trying things with the measure I created like this:

 

Adjusted Project Volume =
IF (
    SELECTEDVALUE ( AdjustedDate[Month] ) = "Apr 2020",
    (
        SUMX (
            FILTER ( 'FactProjection', RELATED ( 'Date'[Month] ) = "Apr 2020" ),
            'FactProjection'[Total Project Volume]
        ) + Adjusted[Adjusted Value]
    ),
    'FactProjection'[Total Project Volume]
)

 

This gives me something like

 

Capture3.JPG

 

April 2020 is now correct but as you can see the other months are not. For the other months they should be equal to the Total Project Volume measure. Any ideas on how I can achieve this??

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

Adjusted Project Volume = 
SUMX (
    DISTINCT ( 'Calendar'[Month] ),
    IF (
        [Month] IN FILTERS ( 'AdjustedDate'[Month] ),
        SUM ( 'Table'[ProjectVolume] ) + [Adjustedt Value],
        SUM ( [ProjectVolume] )
    )
)

 

3.jpg4.jpg


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Perfect. Thank you so much!!

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.