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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I want to calculate some balance sheet indicators. I'm using only one file that contains on the first column the name of the account and in the other columns (for each account) the values from 2017 to 2007.
My file is like this:
How can I sum more values referring, for example, to 2017? I am trying to create a new measure, but without success!
Can you help me pleeease?
Thanks you!
Solved! Go to Solution.
Create a new MEASURE with code like this;
My Measure = CALCULATE ( SUM ( 'Table'[Value] ), 'Table[Account] = "A", 'Table'[Date].Year = 2022 )
Note the purposeful exclusion of the logic for also getting Account = B in this measure. I am going to leave it up to you to research the CACLUCATE funtion, and the Logical Or operator.
Proud to be a Super User! | |
Create a new MEASURE with code like this;
My Measure = CALCULATE ( SUM ( 'Table'[Value] ), 'Table[Account] = "A", 'Table'[Date].Year = 2022 )
Note the purposeful exclusion of the logic for also getting Account = B in this measure. I am going to leave it up to you to research the CACLUCATE funtion, and the Logical Or operator.
Proud to be a Super User! | |
Try UNPIVOT of the data in Power Query. That will get you a dataset like this:
Account Date Value
A 31/12/2022 $200
B 31/12/2022 $300
Now, ALL dates are in the same column.
Proud to be a Super User! | |
Thanks you!
Now, my dataset is like this:
Account Date Value
A 31/12/2022 $200
B 31/12/2022 $300
C 31/12/2022 $100
A 31/12/2021 $700
B 31/12/2021 $400
C 31/12/2021 $200
I need to sum, for example, only the values A and B for the 2022. What's the best DAX expression to do this?
Hello @Vegas95 ,
I would start with unpivoting columns: https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882....
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |