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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
evanj
Regular Visitor

half year vs previous half year

Hi, I am trying to compare 2018H1 vs 2017H1, 2017H2 vs 2016H2 etc (maybe 2018H1 vs 2017H2 also)

 

I have add a column to my date table with 2016H1, 2016H2, 2017H1, 2017H2, 2018H1 etc

 

I can then create a matrix with the year halfs and sales by various categories, but I can't figure out how to do a HY over HY comparison.  QTD vs PQTD I thought may work but could nto do so... please help

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@evanj,

Please check the DAX in the PBIX file below.
https://1drv.ms/u/s!AhsotbnGu1NolAp9LEGTbG1v5r1m

Regards,
Lydia

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

I everyone, the lastest solved was not helpful for me, so I found a new mesure for it and it works very well, it is simple and easy

Measure for Previous Half Year

PH = CALCULATE(Sum[Sales],DATEADD(D_Calendar[Date],-2,QUARTER))

 that is it, you can divide with you current half year, and that is it!

v-yuezhe-msft
Employee
Employee

@evanj,

Please check the DAX in the PBIX file below.
https://1drv.ms/u/s!AhsotbnGu1NolAp9LEGTbG1v5r1m

Regards,
Lydia

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

Hi Lydia,

Could you please share this sample again? 

Apparently, the link to OneDrive is broken.

 

Many tkx !

 

Rolf

thanks, looks promising, I will have to now go understand summarize by the looks 🙂

evanj
Regular Visitor

I did try the below, and it works for H1, but for H2 it has both H1 and H2 added together.

 

Sales Same Period Last year = CALCULATE([YTD Sales],SAMEPERIODLASTYEAR('Calendar'[Date]))

 

and then tried this, which works, except the equation above is wrong...

HoH = DIVIDE([Sales]-[Sales Same Period Last year],[Sales Same Period Last year])

 

for ref,  Sales = SUM(Sales[Ttl AMT])

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors