Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi:
I am doing something called a benford analysis and would like to compare the results month over month.
I have a couple fields [Benf2] and [CycleDate].
I can build a nice cross tab of row counts on these 2 but they don't compare month over month very well unless I express them as a percentage of the column. Benf2 is the row, Cycle Date is the column.
I ended up with the following which works awesome except when it aggregates the total of all months.
M_Prct_Occurs = VAR CountofBenf = COUNTROWS(CAN_MonthlyTrans) VAR CrntCycle = MAX(CAN_MonthlyTrans[Cycle Close Date]) RETURN CALCULATE(CountofBenf / COUNTROWS(Filter(ALL(CAN_MonthlyTrans),CAN_MonthlyTrans[Cycle Close Date]=CrntCycle)))
This returns the correct values in the cross tab for each of the "sub" columns but because I cheated by using the "MAX" formula to define my "CrntCycle" variable. My totals column is comparing the row counts of all Benf2's against the row count of just the last series. If that makes sense.
How should I have defined this so that my totals column works as well.
Solved! Go to Solution.
I think I have solved it, and it was a bit easier than I expected. I defined a new measure that is supposed to do the same.
PercentALBFs = VAR CountofBenf = COUNTROWS(CAN_MonthlyTrans) RETURN CALCULATE(CountofBenf / COUNTROWS(CAN_MonthlyTrans),ALL(CAN_MonthlyTrans[Benf2]))
If I understand this correctly by not saying ALL in the Divisor, I retain the cycle close date filter of the current cycle close date column. Then saying ALL(CAN_MonthlyTrans[Benf2]) in the filter section removes the current row filter. The results appear to be correct. I will mark this as solved once I have confirmed a few more values.
I think I have solved it, and it was a bit easier than I expected. I defined a new measure that is supposed to do the same.
PercentALBFs = VAR CountofBenf = COUNTROWS(CAN_MonthlyTrans) RETURN CALCULATE(CountofBenf / COUNTROWS(CAN_MonthlyTrans),ALL(CAN_MonthlyTrans[Benf2]))
If I understand this correctly by not saying ALL in the Divisor, I retain the cycle close date filter of the current cycle close date column. Then saying ALL(CAN_MonthlyTrans[Benf2]) in the filter section removes the current row filter. The results appear to be correct. I will mark this as solved once I have confirmed a few more values.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
79 | |
66 | |
62 |
User | Count |
---|---|
145 | |
113 | |
105 | |
85 | |
65 |