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.
I have a table that uses a date slicer and contains Customer Name with their Current year revenue using a SUM function, the Prior Year Revenue using a Measure, the Year over Year Revenue Variance as a measure, and a third measure determining the customer status as DECLINER, GAINER, NEW BUSINESS, LOST BUSINESS, or FLAT based on the YOY variance and the revenue fields. It looks as follows:
Customer Name | Revenue Prior Year | Revenue Current | YOY Revenue Variance | CustomerStatus |
CUSTOMER 1 | $1,285,140 | $1,239,289 | ($45,851) | DECLINER |
CUSTOMER 2 | $250,856 | $537,744 | $286,889 | GAINER |
CUSTOMER 3 | $0 | $188,536 | $188,536 | NEW BUSINESS |
CUSTOMER 4 | $1,825 | $0 | ($1,825) | LOST BUSINESS |
CUSTOMER 5 | $1,000 | $1,000 | $0 | FLAT |
CUSTOMER 6 | $650,000 | $700,000 | $50,000 | GAINER |
CUSTOMER 7 | $300,000 | $310,000 | $10,000 | GAINER |
CUSTOMER 8 | $100,000 | $50,000 | ($50,000) | DECLINER |
CUSTOMER 9 | $0 | $100,000 | $100,000 | NEW BUSINESS |
CUSTOMER 10 | $50,000 | $0 | ($50,000) | LOST BUSINESS |
Totals | $2,638,821 | $3,126,569 | $487,749 | GAINER |
What I am trying to do now is create a visual summarizing the above table showing each CustomerStatus, a count of the Accounts in each status, and the Sum of the Revenue Variance of those accounts. Since I cannot use measures as the Rows in a Matrix visual, I assume it will require some DAX that I am in need of help with. The results should look as follows:
CustomerStatus | CountofCustomer | RevenueVariance |
DECLINER | 2 | ($95,851) |
GAINER | 3 | $346,889 |
NEW BUSINESS | 2 | $288,536 |
LOST BUSINESS | 2 | ($51,825) |
FLAT | 1 | $0 |
Totals | 10 | $487,749 |
Thank you for any help on this.
Solved! Go to Solution.
@jeffw14 wheedle to create a dim table with all of status, then put them in the rows of visual
Then create two measures
countofcustomer=countrows(filter(all(facttable[customer name]),[customer status] in values(dimtable[status])))
revenue var=calculate([current revenue],filter(all(facttable[customer name]),[customer status] in values(dimtable[status])))
@jeffw14 wheedle to create a dim table with all of status, then put them in the rows of visual
Then create two measures
countofcustomer=countrows(filter(all(facttable[customer name]),[customer status] in values(dimtable[status])))
revenue var=calculate([current revenue],filter(all(facttable[customer name]),[customer status] in values(dimtable[status])))
Thanks, works great, exactly what I was looking for.
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |