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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
venug
Helper II
Helper II

DAX - FY Year LYTD population

Hi everyone,

 

i am stuck with one scenario, i have sample data.

 

i am unble to get lytd population like below table. i have only fiscal year, there is no date field.

 

Fiscal YearPopulationPopulation LYTD
FY14/1519518 
FY15/161995619518
FY16/172037419956
FY17/182080020374
FY18/192122420800
FY19/202165021224
FY20/212165021650
FY21/222165021650
FY22/23021650
FY23/2400
FY24/2500
Grand Total166822166822

 

Please help on this issue, thnaks in advance.

 

Thanks

Venu

 

 

1 ACCEPTED SOLUTION

@venug 

You need to add a filter to point the minor country. Then select "don't summarize" for the column in the values field.

LastFY population = CALCULATE(SUM('Raw-Data'[Population]), FILTER('Raw-Data','Raw-Data'[rankFY]=EARLIER('Raw-Data'[rankFY])-1),'Raw-Data'[Minor Country]=EARLIER('Raw-Data'[Minor Country]))

 

Best regards
Paul Zheng

 

View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@venug 

I would need a use rankx create an index. The following are 2 calculate columns, give it a try.

 

rankFY = RANKX('Raw-Data',[Time Name],,ASC,Dense)

LastFY population = CALCULATE(SUM('Raw-Data'[Population]),FILTER('Raw-Data','Raw-Data'[Minor Country] = "AFGHANISTAN"),FILTER('Raw-Data','Raw-Data'[rankFY]=EARLIER('Raw-Data'[rankFY])-1))

 

LYFY.JPG

Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@V-pazhen-msft  thanks for respond.

 

i am getting LYTD values very huge. please correct my pbix file.

 

Thanks in advance.

 

Regards

Venu

 

@venug 

You need to add a filter to point the minor country. Then select "don't summarize" for the column in the values field.

LastFY population = CALCULATE(SUM('Raw-Data'[Population]), FILTER('Raw-Data','Raw-Data'[rankFY]=EARLIER('Raw-Data'[rankFY])-1),'Raw-Data'[Minor Country]=EARLIER('Raw-Data'[Minor Country]))

 

Best regards
Paul Zheng

 

Greg_Deckler
Super User
Super User

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  Thanks for respond.

 

your stuff is awesome. 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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