Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Question about Data Architecture within PBI! Please help!

Hello All, 

I do not have an exact use case, but a broader data architecture question. I am slowly learning PBI (coming from a database background) and am wondering how the best way to go about this would be.

 

Essentially, we receive reports every week with our companies current headcount. We want to be able to track changes across the files, i.e If i select Junes file, i want to see how that compares to May, or even the previous weeks file. 

 

The issue im coming across is dynamically comparing files (when i select junes file, know to look at mays file) and then determining if an employee has exited, been hired, or transferred across departments. In a normal scenario, one could simply join the two tables, look for changes and create a column to determine its "status" based ojn the join results. However, im not sure how to accomplish this dynamically in PBI

 

I can provide some dummy data if need be, but any help and guidance is appreciated! 

  • Anonymous Before we go too far down the rabbit hole with this, take a look at the attached PBIX and tell me if this is what you are going for. The following measure shows the people terminated in June even though those terminations show up in July file. Is that what you are going for or no?

    Terminated = 
        VAR __Date = MAX('Sample'[Date])
        VAR __Rank = MAX('Sample'[Rank])
        VAR __CostCenter = MAX('Sample'[Cost Center - ID])
        VAR __EarliestDate = EOMONTH(__Date,-1)+1
        VAR __LatestDate = EOMONTH(__Date,0)
    RETURN
        COUNTROWS(
            DISTINCT(
                SELECTCOLUMNS(
                    FILTER(ALL('Sample'),[Cost Center - ID] = __CostCenter && [Rank] = __Rank - 1 && [Termination Date]>=__EarliestDate && [Termination Date]<=__LatestDate),
                    "__AssociateID",[Associate ID]
                )
            )
        )

    PBIX is below sig

14 Replies