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
GJD23
Frequent Visitor

Sales Growth issues

Hi there - can anyone let me know where i am going wrong - trying to follow one of Chandeep Goodleys videos but not getting expected results - Prev Date correctly shows the previous date - but the Sales doesn't

GJD23_0-1718291037357.png

 

Growth Test =
VAR PrevDateTest =
Maxx(
    Filter(
        ALL(DataFile[Doc. Date]),
        DataFile[Doc. Date] < SELECTEDVALUE(DataFile[Doc. Date])
    ),
    DataFile[Doc. Date]
)
VAR PrevSalesTestXX =
CALCULATE(
    [Sum of Buy Price],
    FILTER(
        ALL(DataFile[Doc. Date]),
        DataFile[Doc. Date] = PrevDateTest
    )
)
RETURN
PrevSalesTestXX


where am i going wrong??

1 ACCEPTED SOLUTION

Hi @GJD23  Great, yes we have to remove the page level filter and check the value. it works as expected worked on similar scenerio. 

Hope you find it useful.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
GJD23
Frequent Visitor

Ah, i have another filter on the page, once i delete this , i get answers- just need to confirm if they are the correct answers lol

Hi @GJD23  Great, yes we have to remove the page level filter and check the value. it works as expected worked on similar scenerio. 

Hope you find it useful.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





GJD23
Frequent Visitor

I still just get periodic answers on some random dates (same as previous) with most dates returning no value - thanks having a look 

rajendraongole1
Super User
Super User

Hi @GJD23 - the above issue might be due to context within the DAX measure. Calculation should correctly evaluates the sales for the previous date

 

Try the below modified measure for growth test:

 

Growth Test =
VAR PrevDateTest =
MAXX(
FILTER(
ALL(DataFile[Doc. Date]),
DataFile[Doc. Date] < SELECTEDVALUE(DataFile[Doc. Date])
),
DataFile[Doc. Date]
)
VAR PrevSalesTestXX =
CALCULATE(
[Sum of Buy Price],
DataFile[Doc. Date] = PrevDateTest,
REMOVEFILTERS(DataFile[Doc. Date])
)
RETURN
PrevSalesTestXX

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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