Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Dear all,
I am currently working on a formula that can accumulate count of unique customers with a total value greater than 0 for each month in the fiscal year. Currently, I have written the formula below for accumulate count of unique customers with a total value greater than 0 (Column 'Total (-VAT)' in raw table).
FY ECO = CALCULATE (
DISTINCTCOUNT(raw[Customer Code]),
FILTER (
ALLSELECTED(raw),
MAX(raw[Billing Date]) >= raw[Billing Date] && SUM(raw[Total (-VAT)]) > 0
))
However, when I drag this formula into the matrix table for visualize, I have to select each corresponding channel in Sub-Channel filter to get the correct desired total for each channel. Image for reference:
However, my matrix table already includes all the channels, and it still displays all unique customers with a total value greater than 0 for each channel as in the formula above when the Sub-Channel is All. Image for reference:
So, how can I adjust the formula to display the accumulate count of unique customers with a total value greater than 0 for each channel, as shown in the table below which I try to get when the Sub-Channel filter is All?
FY ECO | 2021 |
|
|
|
|
|
|
|
|
|
|
|
Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
General Clinic | 146 | 163 | 191 | 211 | 223 | 228 | 233 | 236 | 240 | 251 | 257 | 268 |
GOV.Hospital | 37 | 51 | 69 | 88 | 91 | 106 | 116 | 123 | 127 | 129 | 135 | 140 |
Healthcare Center | 7 | 10 | 12 | 20 | 28 | 31 | 36 | 39 | 41 | 42 | 43 | 44 |
Hospital Pharmacy | 197 | 267 | 311 | 337 | 348 | 363 | 413 | 430 | 442 | 449 | 459 | 470 |
Private Hospital | 120 | 129 | 143 | 152 | 154 | 155 | 161 | 163 | 167 | 161 | 175 | 179 |
Thank you so much in advance for your time when reading my post. Your help would be very apprieciated a lot for me!!!
Solved! Go to Solution.
@blader1989 , Create two measures like , always prefer date table
M1= SUM(raw[Total (-VAT)])
Cumm Sales = CALCULATE(Countx(Values(raw[Customer Code]), if([M1]>0, raw[Customer Code], blank())),filter(allselected(date),date[date] <=max(date[Date])))
Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42
Hello @amitchandak , that's really helped me a lot. Thank you so much.
For the monthly sales order which will be calculated by counting unique customer that total value large than 0, can I use your same formula like this?
M1= SUM(raw[Total (-VAT)])
Monthly sales order = CALCULATE(Countx(Values(raw[Customer Code]), if([M1]>0, raw[Customer Code], blank()))
@blader1989 , Create two measures like , always prefer date table
M1= SUM(raw[Total (-VAT)])
Cumm Sales = CALCULATE(Countx(Values(raw[Customer Code]), if([M1]>0, raw[Customer Code], blank())),filter(allselected(date),date[date] <=max(date[Date])))
Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42