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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ThomasSan
Helper IV
Helper IV

Have fixed sum fill out entire table

Hi everyone,

 

I am trying to create a chart where all figures are normalized at the start point in order to track the relative deviation from it over time. It should look as follows:

ThomasSan_0-1671032923495.png

 

Now, I tried to use the following DAX command:

100% = 
var curr =
CALCULATE(
    sum(Table[SalesTotalEUR]),
    KEEPFILTERS(
        Table[Date]
    )
)

var refer =
CALCULATE(
    sum(Table[SalesTotalEUR]),
    FILTER(
        Table,
        Table[Date].[Year] = 2021 && Table[Date].[MonthNo] =1
    )
)

var div=
DIVIDE(
    curr,
    refer,
    ""
)

return div  

 

However, it results in only row January 2021 being filled out as can be seen here:

ThomasSan_1-1671032996533.png

 

I just cannot figure out where my error is. Can someone please help me here?

 

Thank you in advance!

 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @ThomasSan 

please try

VAR refer =
CALCULATE(
SUM ( Table[SalesTotalEUR] ),
FILTER(
All ( Table[Date] ),
Table[Date].[Year] = 2021 && Table[Date].[MonthNo] = 1
)
)

Thank you for your reply, @tamerj1 !

I have modified my command according to your recommendation and it looks as follows:

100% = 
var curr =
CALCULATE(
    sum('Table'[SalesTotalEUR]),
    KEEPFILTERS(
        'Table'[Date]
    )
)

var refer =
CALCULATE(
    sum('Table'[SalesTotalEUR]),
    FILTER(
        All('Table'[Date]),
        YEAR('Table'[Date])=2021 && MONTH('Table'[Date])=1
    )
)

var div=
DIVIDE(
    curr,
    refer,
    ""
)

return div

As you can see, I was not able to recreate the line Table[Date].[Year] = 2021 && Table[Date].[MonthNo] = 1 but my workaround should not alter the result.

 

Unfortunately, my result is still as follows:

Thomas_San_0-1671122975734.png

The underlying table is a flat table i.e. the date column is in the same column as the SalesTotalEUR column.

 

Do you know what might be the issue here?

Hi @Thomas_San 

are you using a date table? If not please try

100% =
VAR curr =
SUM ( 'Table'[SalesTotalEUR] )
VAR refer =
CALCULATE (
SUM ( 'Table'[SalesTotalEUR] ),
YEAR ( 'Table'[Date] ) = 2021
&& MONTH ( 'Table'[Date] ) = 1,
ALLEXCEPT ( 'Table', 'Table'[Country Code] )
)
VAR div =
DIVIDE ( curr, refer, "" )
RETURN
div

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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