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
Nihed
Helper III
Helper III

Calculation on dax (Urgent)

Hello,

Who can help me on this urgent subject please,

 

I have a table that contains the following data on power BI

Nihed_0-1668689755987.png

 

my request is :

Calculate each Employee Group’s Headcount change per year as a percentage comparing to prev year.

how I can do this calculation on dax for final objective to make this visual?

Nihed_0-1668690258011.png

 

 

 

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

12 REPLIES 12
daXtreme
Solution Sage
Solution Sage

File attached

@daXtreme  I’m really happy it works super well thank you very much🙂

BeaBF
Impactful Individual
Impactful Individual

@Nihed Hi! Can you paste some sample data?

 

BBF

I share with you an example for my data

 

Calendar yearHeadcountEmployee GroupDirectorate
201310TemporarySGE
201313OfficialEXD
201712OfficialCTP
201710OfficialDAF
201713TemporaryEDU
201411OfficialEDU
201410TemporaryEDU
201510OfficialNEA
201613OfficialEXD
201615TemporaryEDU
201710OfficialEDU
201711OfficialELS
201710OfficialGOV
201812TemporaryGOV
201810OfficialNEA
201910TemporaryCFE
201912OfficialEXD
202010TemporaryGOV
202011OfficialGOV
202010OfficialGOV
202111OfficialEXD
202115OfficialCTP
202111OfficialSTI
202210OfficialEXD
202211OfficialEXD
202211Associated staffCTP
202215OfficialCTP
202214OfficialCTP
202213TemporaryEDU

 

BeaBF
Impactful Individual
Impactful Individual

@Nihed can you paste a table with the expected results? I can't understand how you obtain 12,5% for example in the first chart for 2013.

 

BBF

I share with you the link to download the correct file:

 

https://we.tl/t-6g3kvoLsad 

BeaBF
Impactful Individual
Impactful Individual

@Nihed Access is denied. Try this measures:

MEDIA = CALCULATE(MEDIAN('Table'[Headcount]), ALLEXCEPT('Table','Table'[Calendar year],'Table'[Employee Group]))
 
PREVYEAR =
VAR YYEAR = SELECTEDVALUE('Table'[Calendar year])
VAR PREVYEAR = YYEAR - 1
RETURN CALCULATE([MEDIA],'Table'[Calendar year] = YYEAR) - CALCULATE([MEDIA],'Table'[Calendar year] = PREVYEAR)
 
BBF

It doesn’t work I have the Media measurement equal 0

BeaBF
Impactful Individual
Impactful Individual

@Nihed Try to attack here your pbix file 

 

BeaBF_0-1668702336806.png

 

how I can do it I don’t know how,if you can do it yourself I’d be grateful 

BeaBF
Impactful Individual
Impactful Individual

@Nihed 

BeaBF_0-1668702853040.png

 

 

I couldn’t have sent you this I’ve been sitting for a while and it’s not working

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