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.
Hey Everyone
I am new to PBI. I need a measure that caculates a total by grouping by two columns in the table. I have one but but it doesn't give me the correct restults.
Table Name = MonthlyInvoice
+-----+-----------+-----+
| CID | Month | Amt |
+-----+-----------+-----+
| 101 | 1/01/2020 | 15 |
| 101 | 1/01/2020 | 20 |
| 101 | 1/01/2020 | 25 |
| 101 | 2/01/2020 | 35 |
| 101 | 2/01/2020 | 40 |
| 101 | 2/01/2020 | 45 |
| 201 | 1/01/2020 | 35 |
| 201 | 1/01/2020 | 40 |
| 201 | 1/01/2020 | 55 |
| 201 | 2/01/2020 | 65 |
| 201 | 2/01/2020 | 70 |
| 201 | 2/01/2020 | 75 |
+-----+-----------+-----+
The goal is a measure that calculates the total per ClientID/Month for Amount
+-----+-----------+-----+-----+
| CID | Month | Amt | Tot |
+-----+-----------+-----+-----+
| 101 | 1/01/2020 | 15 | 60 |
| 101 | 1/01/2020 | 20 | 60 |
| 101 | 1/01/2020 | 25 | 60 |
| 101 | 2/01/2020 | 35 | 120 |
| 101 | 2/01/2020 | 40 | 120 |
| 101 | 2/01/2020 | 45 | 120 |
| 201 | 1/01/2020 | 35 | 130 |
| 201 | 1/01/2020 | 40 | 130 |
| 201 | 1/01/2020 | 55 | 130 |
| 201 | 2/01/2020 | 65 | 133 |
| 201 | 2/01/2020 | 70 | 133 |
| 201 | 3/01/2020 | 75 | 75 |
+-----+-----------+-----+-----+
I tried using these two, however I am clearing not getting it.
Thanks for the suggestions. I left out some important infor. The data field that I have is not an actual date. It's a key in the format yyyymmdd.
Hi @jspitler ,
Not sure what you meant by that.Best practise to have Date Fields marked as Date.
However, you can create a Calculated Column.
Hi @jspitler ,
Did the solution work for you.
Please mark as solution for other community members to benefit.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @jspitler ,
Create a Calendar Table and then link you relationship between Calendar Table and Monthly Invoice Table.
Post which you can just drag and Drop, the dates from the month Table and other details from the Monthly Invoice Table.
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!
Thinking probably something along the lines of:
Column =
SUMX(
FILTER(
'Table',
[Month] = EARLIER([Month]) &&
[CID] = EARLIER([CID])
),
[Amt]
)
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 |
---|---|
39 | |
25 | |
20 | |
14 | |
8 |
User | Count |
---|---|
71 | |
48 | |
46 | |
20 | |
16 |