The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello, DAX experts
I have to calculate a measure (not a calculated column) to show DAILY production based on the number of calendar days in the reporting period. Production is a monthly entry in the Ledger.
Expected result is for
Jan 2020 is 391,106.81 divided by 31 days in Jan 2020, i.e. 12,616 units per day if I select Jan 2020 on visual (stacked monthly bar) of daily production for selected gas product, etc
I must say that the datatable contains various ledgers for actual, budget, forecast and then different type of gas products, etc. So I already have a measure that provides me monthly total production by gas product, but now I have to find daily average production. Ideas?
Ledger | Account Code | Accounting Period | Unit of Production |
K | SALEGAS | 2020/001 | - 391,106.81 |
K | SALEGAS | 2020/002 | - 361,155.52 |
K | SALEGAS | 2020/003 | - 361,305.28 |
K | SALEGAS | 2020/004 | - 331,295.20 |
K | SALEGAS | 2020/005 | - 335,115.11 |
K | SALEGAS | 2020/006 | - 339,092.06 |
K | SALEGAS | 2020/007 | - 318,675.72 |
Thanks in advance
Mira
Solved! Go to Solution.
@Anonymous
Add the following column in your table
Daily Avg =
VAR _Days = DAY(EOMONTH(DATE(LEFT(TRX[Accounting Period],4),RIGHT(TRX[Accounting Period],2),1),0))
return
DIVIDE(
TRX[Unit of Production],
_Days
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Add the following column in your table
Daily Avg =
VAR _Days = DAY(EOMONTH(DATE(LEFT(TRX[Accounting Period],4),RIGHT(TRX[Accounting Period],2),1),0))
return
DIVIDE(
TRX[Unit of Production],
_Days
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
21 | |
14 | |
14 | |
9 | |
7 |