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 all,
I'm back with another problem that I can't figure out how to do solve.
I've the table 'Billed' with the total invoiced in each division and month, and I want to add a column with the Total of C&R done per Division in each month (which I've in another table named 'C&R report'). I can't find a way to obtain the subtotal per division in each month, I tried different formulas but it doesn't work.
Below you can find the tables that I have:
C&R Report:
Date | Division | C&R |
01-Jul | Retail | 1 |
01-Jul | Vehicles | 0 |
01-Jul | Ocean | 0 |
01-Jul | Air | 1 |
01-Jul | Air | 1 |
01-Jul | Ocean | 0 |
01-Jul | Ocean | 1 |
01-Jul | Retail | 0 |
01-Jul | Vehicles | 0 |
01-Jul | Retail | 0 |
01-Jul | Retail | 1 |
01-Jul | Vehicles | 1 |
01-Aug | Ocean | 0 |
01-Aug | Retail | 1 |
01-Aug | Ocean | 1 |
01-Aug | Vehicles | 1 |
01-Aug | Air | 0 |
01-Aug | Vehicles | 0 |
01-Aug | Retail | 1 |
01-Aug | Air | 1 |
01-Aug | Air | 0 |
01-Aug | Vehicles | 1 |
01-Aug | Air | 0 |
Billed:
Date | Division | Total billed |
01-Jul | Retail | 200,199.00 |
01-Jul | Vehicles | 175,839.00 |
01-Jul | Ocean | 134,094.00 |
01-Jul | Air | 209,302.00 |
01-Aug | Retail | 210,290.00 |
01-Aug | Vehicles | 185,043.00 |
01-Aug | Ocean | 98,202.00 |
01-Aug | Air | 225,029.00 |
The result that I'm looking for would be as follow:
Date | Division | Total billed | C&R per Division |
01-Jul | Retail | 200,199.00 | 2 |
01-Jul | Vehicles | 175,839.00 | 1 |
01-Jul | Ocean | 134,094.00 | 1 |
01-Jul | Air | 209,302.00 | 2 |
01-Aug | Retail | 210,290.00 | 2 |
01-Aug | Vehicles | 185,043.00 | 2 |
01-Aug | Ocean | 98,202.00 | 1 |
01-Aug | Air | 225,029.00 | 1 |
As you can see, the column "C&R per division" got the Total of C&R done in each month for each division.
How can I obtain that with DAX?
I tried the following:
Solved! Go to Solution.
Ohhh men, I've figured it out! I can't be more excited!
I thought in delete the topic, but I think is better to share the answer.
I solve it adding the "ALLEXCEPT" expresion. So the complete formula would be:
CALCULATE(
SUMX(
FILTER('C&R Report','C&R Report'[Billing Year/Month]
&& 'C&R Report'[Division]),'C&R Report'[To Be Reported in ET Metrics]),
ALLEXCEPT('Calendar','Calendar'[Date].[Date]))
The table 'Calendar' is a Date dimension table.
Hope it will help others!
Ohhh men, I've figured it out! I can't be more excited!
I thought in delete the topic, but I think is better to share the answer.
I solve it adding the "ALLEXCEPT" expresion. So the complete formula would be:
CALCULATE(
SUMX(
FILTER('C&R Report','C&R Report'[Billing Year/Month]
&& 'C&R Report'[Division]),'C&R Report'[To Be Reported in ET Metrics]),
ALLEXCEPT('Calendar','Calendar'[Date].[Date]))
The table 'Calendar' is a Date dimension table.
Hope it will help others!
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 | |
23 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |