cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Unable to calculate sales for max month

Hi Gurus,

 

I got Stuck in calculating Sales for the max month based on the selected slicer in power BI.

 

Senario:

1. I have a dimenssion called Report Type in this I have two attributes (Available , Common). 

2. For Available my max date is June-2017 & for Available it is May-2017.

 

I tried :

1. Created a measure called Max_Date_Competitor= IF(HASONEFILTER(Competitor[ReportType]),MAXX(Competitor,Competitor[TIME_YEAR_MONTH].[Date]))

2. Created another files Max_Sales = 

CALCULATE(SUM(Competitor[GROWTH_YTD_NUM_CY]),FILTER(Competitor,Competitor[TIME_YEAR_MONTH].[Date]=[Max_Date_Competitor]))

 

But System is returing sum of all sales happened since data available.

 

Please help me how Can I do the same.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi Yulgu,

 

Thanks for your time. I solved this problem by reading DAX function from microfoft side https://msdn.microsoft.com/en-us/library/ee634380.aspx

 

Max_Sales =
CALCULATE (
    SUM ( Competitor[GROWTH_YTD_NUM_CY] ),
    lastdate(Competitor[Max_Date_Competitor])
    )

View solution in original post

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Hi @SandySharma,

 

Please try this formula:

Max_Sales =
CALCULATE (
    SUM ( Competitor[GROWTH_YTD_NUM_CY] ),
    FILTER (
        Competitor,
        MAX ( Competitor[TIME_YEAR_MONTH].[Date] ) = Competitor[Max_Date_Competitor]
    )
)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hi Yulgu,

 

Thanks for your time. I solved this problem by reading DAX function from microfoft side https://msdn.microsoft.com/en-us/library/ee634380.aspx

 

Max_Sales =
CALCULATE (
    SUM ( Competitor[GROWTH_YTD_NUM_CY] ),
    lastdate(Competitor[Max_Date_Competitor])
    )

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors