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 am an absolute DAX beginner and am looking for a solution to the following problem:
In the following table there are companies, departments, date (monthly period) and a value.
Now I am looking for a way to create a DAX Querry which sums up all companies for a specific department (100 in the example).
This in the current year and in the last year. A date table is already created.
Questions:
Which is the best variant for this case?
Calculate(sum(Lookupvlaue... or Calculte(sum(filter....
Are there any examples for this case?
Thanks for help
Hi,
I am not sure about how your expected outcome looks like, but in case if you want to create a table visualization, please check the attached file and the below picture.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim thanks for the answer. the table would clearly be the easiest. but I need the values in a measure for other visuals and further calculations.
Hi,
Thank you for your feedback.
Please check the below picture and the attached pbix file.
I added a measure.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you very much for the file and the answer.
The aim is to have all values in 2 periods in different measures.
Measure 1: Sum of all companies in division 100 from January 2021 (last year/month dynamically using Date column).
Measure 2: Sum of all companies in derivation 100 (January 2022) from current year (last year/month dynamically using Date column)
The correct data includes further departments (e.g. 200 etc.).
The calculations in this case are liquid assets (from a balance sheet).
Finally, I need the total per department in a period (independent of the company), in individual measures which I can then use further (e.g. balance sheet ratios, liquidity level etc).
Hi,
Thank you for your feedback.
Could you please share your sample pbix file's link? I think only seeing the excel file's screenshot makes me a little bit confuse to create a solution.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
clear here in the link for download: https://xfl.jp/MexV9p
The structure of the data does not differ much from the demo data in Excel.
Here is another explanation:
These are raw data from a financial programme. For this, departments (cost centres of departments) would have to be processed across several companies.
To do this, I have to sum up individual cost centres (departments) across companies (Company column).
Department (cost centre) 100 = Cash and cash equivalents
Department (cost centre) 130 = Inventories
In the end, the totals are then put in relation (%) to each other.
For example: 100 (Sum uf all Deparemnets) / 130 (Sum uf all Deparemnets).
The difficulty, however, lies in the period (history). In order to display this on a monthly basis (e.g. on a line chart), I have to create measures in advance where I can then calculate the ratios. The ratios are then combined (e.g. with a target value) in the line chart.
In the meantime I have tried and tried with "lookupvalue" and there it seems to be limited because I need several criteria (this year -1 and department 100 for example).
thx for help
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 |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |