Forum Discussion
How to countif per columns to 1 unique Data
- 6 years ago
You can just do a reference to the table and create a copy in power query. Then you can do all kinds of pivots without ruining your original table.
The other solution i had in mind is creating a small table:A
B C Then create a relationship between this column and each of your week columns. The relationships should not be active.
Finally create measures, along this lines of this:Week1 = Calculate(countrows([Week1]) ; USERELATIONSHIP( [NewColumn] ; Week1))Week2 = Calculate(countrows([Week2]) ; USERELATIONSHIP( [NewColumn] ; Week2))etc...
Finally use the A/B/C column in the new table as a legend or row dimension with the new measures and you should be all set.
I'm going on lunch but let me know if you need any help!
/ J - 6 years ago
Alright, never mind my previous message. Heres the columns:
week1 times = VAR cat = Table2[Result] VAR UT = Table2[Unit Time] return CALCULATE(COUNTROWS(Table1) * UT;Table1[Week1] = cat )week2 times = VAR cat = Table2[Result] VAR UT = Table2[Unit Time] return CALCULATE(COUNTROWS(Table1) * UT;Table1[Week2] = cat )week3 times = VAR cat = Table2[Result] VAR UT = Table2[Unit Time] return CALCULATE(COUNTROWS(Table1) * UT;Table1[Week3] = cat )
/ J
Hi, i have attached the example below in onedrive
https://1drv.ms/u/s!AvR5HzU6KTFHjzB36pZthOULapqe?e=grVqcg
If you load it up and go to 'Data' and look at table 2, the week2 times is giving a cicular reference.
Alright, never mind my previous message. Heres the columns:
week1 times =
VAR cat = Table2[Result]
VAR UT = Table2[Unit Time]
return
CALCULATE(COUNTROWS(Table1) * UT;Table1[Week1] = cat )week2 times =
VAR cat = Table2[Result]
VAR UT = Table2[Unit Time]
return
CALCULATE(COUNTROWS(Table1) * UT;Table1[Week2] = cat )week3 times =
VAR cat = Table2[Result]
VAR UT = Table2[Unit Time]
return
CALCULATE(COUNTROWS(Table1) * UT;Table1[Week3] = cat )
/ J
- TT16 years ago
Helper I
Wow, amazing. Thanks very much