Forum Discussion
2 values in axis
Hi Icey,
I thought that everything is perfect, but I miss one point and the file didn't work. I will explain in details.
In my graph, i have a slicer for name and the data should show based on the selection. The category values and name are repeating in my data. I added three more rows to the previous table.
name | category | PTIme | KTime | Price | KPrice |
john | a | 1 | 1 | 10 | 160 |
john | b | 1 | 2 | 15 | 150 |
john | d | 2 | 3 | 16 | 160 |
john | e | 2 | 3 | 18 | 190 |
john | f | 3 | 3 | 20 | 180 |
john | g | 4 | 5 | 23 | 160 |
john | h | 4 | 6 | 26 | 110 |
john | i | 5 | 7 | 30 | 140 |
john | j | 6 | 7 | 32 | 130 |
john | k | 6 | 7 | 35 | 120 |
john | l | 7 | 7 | 39 | 100 |
Maj | j | 12 | 3 | 50 | 80 |
Maj | k | 16 | 2 | 55 | 70 |
Maj | l | 15 | 1 | 60 | 50 |
When there is repeated value, it should be provide the data with the formula below, which i did by adding custom column:
PTime2=[PTIme]*[Price]/[Price]
Ktime2=[KTime]*[KPrice]/[KPrice]
|
|
|
|
|
| PTime2 | KTime2 |
john | j | 6 | 7 | 32 | 130 | 192 | 910 |
john | k | 6 | 7 | 35 | 120 | 210 | 840 |
john | l | 7 | 7 | 39 | 100 | 273 | 700 |
Maj | j | 12 | 3 | 50 | 80 | 600 | 240 |
Maj | k | 16 | 2 | 55 | 70 | 880 | 140 |
Maj | l | 15 | 1 | 60 | 50 | 900 | 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600+192 | 240+910 |
|
|
|
|
|
| 792 | 1150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32+50 | 130+80 |
|
|
|
|
|
| 82 | 210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 792/82 | 1150/210 |
|
| if nothing is selected: | j | 10 | 5 |
If we go with the example for category j, in no name is selected, it should be shown under Ptime2: value 10 and Ktime2:value 5. If John is selected, it should be shown under Ptime:5, KTime:7.
I followed the steps that you provided, but it shows different result for the repeated values.
Here is the file that I used if you can have a look at it. : https://gofile.io/d/V8Fonh
I know that I kept too much of your time, but this is a very good example for the ones that are using repeated values and slicer, which is the case most of the time.
regards,
- Icey5 years agoCommunity Support
Hi IF ,
I can't download your file.
Can't you open the file attached under my last reply? There are some changes in it. If you can't open it, I will explain what I did in details.
Best Regards,
Icey
- IF5 years agoPost Prodigy
Hi again,
What you provided is very clear. When there are different names and same categories, then it doesn't work. For example;
name
category
PTIme
KTime
Price
KPrice
john
a
1
1
10
160
john
b
1
2
15
150
john
d
2
3
16
160
john
e
2
3
18
190
john
f
3
3
20
180
john
g
4
5
23
160
john
h
4
6
26
110
john
i
5
7
30
140
john
j
6
7
32
130
john
k
6
7
35
120
john
l
7
7
39
100
Maj
j
12
3
50
80
Maj
k
16
2
55
70
Maj
l
15
1
60
50
I added last three rows. I added new columns to the power bi file as well:
PTime2=[PTIme]*[Price]/[Price]
Ktime2=[KTime]*[KPrice]/[KPrice]
Let's look at category "j". If no name is selected, it should be shown under Ptime2: value 10 and Ktime2:value 5 based on the formula or new columns that I explained (there are two values for category j: one for John and one for Maj). If John is selected, it should be shown under Ptime:5, KTime:7.
Here is the new link from dropbox:
https://www.dropbox.com/s/mzm9w83cz1wf0pl/2%20values%20in%20axis%20-%20increaseddata%202.pbix?dl=0
I tried this link but it works for me: https://gofile.io/d/V8Fonh
I hope one of them works for you at least.
I hope it is clear and you can find a solution. 🙂
regards,
- IF5 years agoPost Prodigy
Hi Icey,
Was my explanation clear?
Regards,