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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
tnevarez
Frequent Visitor

Help with defining starting row value

Hello!  I am new to the forum and am stuck trying to come up with a formula/measure.  I am needing to index 3 different data sets in order to align them on the same scale instead of graphing with multiple axis.  I know what formula I need to be using but the issue I am having is defining the initial value.  I want to be able to use a filter slicer to graph different date ranges of the data so the initial value would change depending on the date selected.   You can see from the 2 different charts (modeled in excel) that even with a secondary axis the data sets are too different to plot effectively (item 3 is too small to plot).  By indexing the values, I am able to narrow the scale to show the variations better.

 

The formula I need is: (Current value/Initial value)*100

 

tnevarez_0-1692303704014.png

 

Any help would be GREATLY appreciated; thanks!!

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can create three measures (one for each Item) with the following...

Item 1 Indexed Value = 
var _initialValueDate =
//gets the minimum week end date from the table for the dates that are SELECTED(Filtered)
MINX(
    ALLSELECTED('Table'),
    'Table'[Week End Date]
)
var _initialValue =
//gets the Item 1 value that coresponds to the intial date calculated
LOOKUPVALUE(
    'Table'[Item 1],
    'Table'[Week End Date],
    _initialValueDate
)
return
//returns the indexed value using the inital value calculated from the initial date
ROUND(
    DIVIDE(
        MIN('Table'[Item 1]),
        _initialValue,
        0
    )
    *100,
    0
)

You should end up with...

jgeddes_0-1692306719233.png

 

jgeddes_1-1692306742684.png

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
tnevarez
Frequent Visitor

Thank you for the quick reply! 

 

Based on the lookup value needed I am going to have to do some pre-work to get Items 1, 2, & 3 into a column within one of my data tables since they are currently measures.  I have a master data table that pulls in values for Items 1-~100 in a single column with each row a daily date.  I had to create the measures to get a calculation for Item 1 (for example, using Items (5+10+13+20) - 18, and then additional measure for Items 1, 2, & 3 to calculate the weekly averages.  So currently even though all of the values reside in my master data table, I had to create the measures for the desired results.  Once I can get them into a table to perform the lookup value, I will be able to try your solution.

 

Thanks!

jgeddes
Super User
Super User

You can create three measures (one for each Item) with the following...

Item 1 Indexed Value = 
var _initialValueDate =
//gets the minimum week end date from the table for the dates that are SELECTED(Filtered)
MINX(
    ALLSELECTED('Table'),
    'Table'[Week End Date]
)
var _initialValue =
//gets the Item 1 value that coresponds to the intial date calculated
LOOKUPVALUE(
    'Table'[Item 1],
    'Table'[Week End Date],
    _initialValueDate
)
return
//returns the indexed value using the inital value calculated from the initial date
ROUND(
    DIVIDE(
        MIN('Table'[Item 1]),
        _initialValue,
        0
    )
    *100,
    0
)

You should end up with...

jgeddes_0-1692306719233.png

 

jgeddes_1-1692306742684.png

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you again for the solution!  I was finally able to dedicate time to get all these measures moved into a single table to perform the lookup function and your formula works perfect!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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