Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Following is my current table with the first 2 columns (Group By and To Count):
Group by | To Count | New Column |
A | XYZ | 2 |
A | XYZ | 2 |
A | MNO | 2 |
B | MNO | 3 |
B | GHK | 3 |
B | TRP | 3 |
I'm trying to add the new column which partitions the table by "Group by" column and finds distinct count of "To Count" column. This new column needs to be used for another calculation, hence it should be static value across the table. What's the best way to achieve this?
Solved! Go to Solution.
Allexcept is used to get the partitioned by
Refer this ia a good example
https://community.powerbi.com/t5/Desktop/highest-value-by-category/td-p/428758
Try
New Column =
CALCULATE (
count ( 'Table'[To Count] ),
ALLEXCEPT ( 'Table', 'User Table'[Group by] )
)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi,
Write this calculated column formula
=CALCULATE(DISTINCTCOUNT(Data[To Count]),FILTER(Data,Data[Group By]=EARIER(Data[Group By])))
Hope this helps.
Allexcept is used to get the partitioned by
Refer this ia a good example
https://community.powerbi.com/t5/Desktop/highest-value-by-category/td-p/428758
Try
New Column =
CALCULATE (
count ( 'Table'[To Count] ),
ALLEXCEPT ( 'Table', 'User Table'[Group by] )
)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |