cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
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.

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
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors