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 Community!
I have a Table with the first 2 columns of the following example (ID and Time_1), and I need to add a third column (Time_2), in order to get something like this:
ID | Time_1 | Time_2 |
1 | 30 | 10 |
1 | 30 | 10 |
1 | 30 | 10 |
2 | 50 | 50 |
3 | 40 | 20 |
3 | 40 | 20 |
4 | 80 | 20 |
4 | 80 | 20 |
4 | 80 | 20 |
4 | 80 | 20 |
Taking ID = 15 as example, Time_2 should be calculated as 30/3 = 10 (30 is the value of Time_1 and 3 is how many times Order 15 is repeated).
I’d be grateful if I could get some help. Thanks in advance
Solved! Go to Solution.
@aceremin - Try this:
Time_2 =
VAR __Time_1 = [Time_1]
VAR __Num = COUNTROWS(FILTER('Table (18)',[ID]=EARLIER([ID])))
RETURN
__Time_1/__Num
PBIX is attached below sig. Table (18).
@aceremin ,
Try this formula:
Hi @nandic
Thanks for your help.
But I am not getting the result I was expecting.
The column Time_2 shows me the Time_1 value.
Looks like _Id_Count is not counting the number of times the ID appears in the column.
I tried creating the column _Id_Count separatelly, and I get 1 as a result for each row.
In my example I should get something like:
I hope this is clear. Do you know what I should do?
Thanks again!
@aceremin - Try this:
Time_2 =
VAR __Time_1 = [Time_1]
VAR __Num = COUNTROWS(FILTER('Table (18)',[ID]=EARLIER([ID])))
RETURN
__Time_1/__Num
PBIX is attached below sig. Table (18).
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 |