Reply
GJD23
Frequent Visitor
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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!





avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)