Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello everyone
I have the following table that has 4 columns called: Period, ID, Job Title, and Start Date. The table can have multiple IDs, and each ID can have multiple charges. I need a new column without using the offset function, which shows me the Period in which I change the Charge for each ID, this new column called "Change Period", does NOT have to consider the first charge for each new Start Date as a change of charge. The idea is that the new column is shown below.
Solved! Go to Solution.
First, you can create a new index column in the Power Query interface.
Then you can use the following dax to get the result you want.
Change Period =
VAR CurrentRowID = 'Table'[ID]
VAR PreviousRowID = LOOKUPVALUE('Table'[ID],'Table'[Index],'Table'[Index]-1)
VAR CurrentRowJobTitle = 'Table'[Job Title]
VAR PreviousRowJobTitle =
LOOKUPVALUE('Table'[Job Title],'Table'[Index],'Table'[Index]-1)
RETURN
IF(
CurrentRowID <> PreviousRowID,
BLANK(),
IF(CurrentRowJobTitle = PreviousRowJobTitle,BLANK(),'Table'[Period])
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
First, you can create a new index column in the Power Query interface.
Then you can use the following dax to get the result you want.
Change Period =
VAR CurrentRowID = 'Table'[ID]
VAR PreviousRowID = LOOKUPVALUE('Table'[ID],'Table'[Index],'Table'[Index]-1)
VAR CurrentRowJobTitle = 'Table'[Job Title]
VAR PreviousRowJobTitle =
LOOKUPVALUE('Table'[Job Title],'Table'[Index],'Table'[Index]-1)
RETURN
IF(
CurrentRowID <> PreviousRowID,
BLANK(),
IF(CurrentRowJobTitle = PreviousRowJobTitle,BLANK(),'Table'[Period])
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |