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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Trying to get data 12 months back from an excel sheet

Hi, 
I have this excel sheet:

royarne83_0-1675775215579.png

 

The data looks like this after loading in pbi:

royarne83_1-1675774770800.png

 

My code

 

my measure= 
IF(
    HASONEFILTER('DSV Companies'[CompanyName]),
    CALCULATE(
        sum(Registrering[Verdi]),
        FILTER(
            Registrering,
            Registrering[KPI_nr] = 3 &&
            Registrering[Måned og År.Start of Month] >= EOMONTH(TODAY(), -12) &&
            Registrering[Måned og År.Start of Month] <= EOMONTH(TODAY(), 0)
        )
    ),
    CALCULATE(
        SUM(Registrering[Verdi]),
        FILTER(
            ALL(Registrering),
            Registrering[Selskap] = "my company" &&
            Registrering[KPI_nr] = 3 &&
            Registrering[Måned og År.Start of Month] >= EOMONTH(TODAY(), -12) &&
            Registrering[Måned og År.Start of Month] <= EOMONTH(TODAY(), 0)
        )
    )
)

 

 

 

Still, when I test I don't get data 12 months back. Even if I try 15 mohnts back it does no show the correct data. The above example gives me 1, and not 2. 
Seems to be happening something when I'm reaching 12 months back. 

Do you see whats wrong here?

 

1 REPLY 1
Anonymous
Not applicable

Nobody? 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.