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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Reepa
New Member

Line chart of Index not matching the underlying data

Hi,

 

I am currently trying to make a single index with base 100 from 3 different prices on a monthly data set.

 

Everything looks good in a data table where the index is showing. It takes different values mainly in the range 90-100. I also defined the index to be 0 for dates before the base date. 

 

The problem is that when I make a line chart (or any chart for that matter), the chart only gives 0 or 100. The 0 part is all good, but it only gives a flat line of 100 for dates after the base date, even though the table gives all kinds of values. What could be wrong here? How do I fix this?

 

I appreciate all help I can get, thank you!


***Excel data below***

 

Data here

 

***DAX below***

Weighted_Average_Index =
VAR BaseTable =
    CALCULATETABLE (
        TOPN ( 1, Data, Data[Date], ASC ),
        ALLSELECTED ( Data[Date] )
    )
VAR BasePrice_Price1 =
    MAXX ( BaseTable, Data[Price1] )
VAR BasePrice_Price2 =
    MAXX ( BaseTable, Data[Price2)] )
VAR BasePrice_Price3 =
    MAXX ( BaseTable, Data[Price3] )

VAR CurrentPrice_Price1 =
    SELECTEDVALUE ( Data[Price1] )
VAR CurrentPrice_Price2 =
    SELECTEDVALUE ( Data[Price2] )
VAR CurrentPrice_Price3 =
    SELECTEDVALUE ( Data[Price3] )

VAR Weighted_Index_Price1 =
    DIVIDE ( CurrentPrice_Price1, BasePrice_Price1 ) * 100 * 0.7
VAR Weighted_Index_Price2 =
    DIVIDE ( CurrentPrice_Price2, BasePrice_Price2 ) * 100 * 0.24
VAR Weighted_Index_Price3 =
    DIVIDE ( CurrentPrice_Price3, BasePrice_Price3 ) * 100 * 0.06

VAR Weighted_Average =
    Weighted_Index_Price1 + Weighted_Index_Price2 + Weighted_Index_Price3

RETURN
    IF (
        NOT ISEMPTY ( CALCULATETABLE ( Data, ALL ( Data[Date] ) ) ),
        Weighted_Average + 0
    )


***Pictures below***

Snip chart not working.pngSnip table working.png
1 REPLY 1
Anonymous
Not applicable

Hi @Reepa 

 

I got a table like this using your dax

vjialongymsft_0-1706775013782.png

 

My results don't seem to be the same as your output, can you provide your PBIX file, so that I can help you better. Please remove any sensitive data in advance.

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors