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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Lalit_101
Regular Visitor

employee salary month wise

i have a table like below

emp codemonthlycoststart dateend date 
11000001-apr-2131-mar-22 
11500001-apr-22  
22000001-apr-2131-mar-22 

 

i need to show this as month wise total cost like below

apr-2130000(sum of 10000+20000)
may-2130000
june-2130000
apr-22 15000 (then it will show me cost where start date is after 1apr22 and e
  
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

I suggest having a Dim-Calendar table.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1669622187634.png

 

Jihwan_Kim_1-1669622525936.png

 

 

Salary sum measure: =
SUMX (
    FILTER (
        Data,
        Data[start date] <= MAX ( 'Calendar'[Date] )
            && OR ( Data[end date] >= MIN ( 'Calendar'[Date] ), Data[end date] = BLANK () )
    ),
    Data[monthlycost]
)

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Lalit_101
Regular Visitor

thank for your help. you are expert.

it's working now

also i have to crack i more logic i have two table like below

1. Live employee Master table

empcodeBUfunction
E100AGRIHR
E101ECER&D
E102AGRIFin
E103AGRIHR

 

2. Transfer table

empcodeAttributeTypeDescriptionNewAttributeDescOLDAttributeDescEffectiveDate
E100BUAGRIECE01-Apr-22
E101FunctionR&DFin5-May-22

 

i have already created calender table

need to create data like if slicer is BU is AGRI and Fun is HR 

Monthheadcount
feb-222
mar-222
apr-223
may-223
june-223
and so on3

 

if slicer is BU is ECE and Fun is R&D

Monthheadcount
feb-220
mar-220
apr-220
may-221
june-221
and so on1

 

pls help

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

I suggest having a Dim-Calendar table.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1669622187634.png

 

Jihwan_Kim_1-1669622525936.png

 

 

Salary sum measure: =
SUMX (
    FILTER (
        Data,
        Data[start date] <= MAX ( 'Calendar'[Date] )
            && OR ( Data[end date] >= MIN ( 'Calendar'[Date] ), Data[end date] = BLANK () )
    ),
    Data[monthlycost]
)

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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