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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.