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 everybody, Im creating a matrix in PowerBi that displays various data. One of those is the "aging" of a certain item, so it will be displayed on the last day of the month.
The issue I'm facing is that the value will not be shown unless I drill down to "DAY"via Date Hierarchy (Month, Day), but I need it to be displayed also when showing the month.
Can anyone help me solve this?
-----------------------------------------------------
----------------------------------------------------
Thank you for your solution @johnbasha33
Hi, @glamanna
Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!
Best Regards
Jianpeng Li
It seems like you're trying to calculate the aging of certain items on the last day of each month and display it in a matrix in Power BI. The issue you're facing is that the aging value is not shown unless you drill down to the "DAY" level via Date Hierarchy (Month, Day), but you need it to be displayed even when showing the month.
To address this issue, you can modify your DAX measures to ensure that the aging value is calculated correctly at both the month and day levels. Here's how you can modify your measures:
1. **AGING average eomonth**:
```DAX
AGING average eomonth =
VAR CurrentMonth = MONTH('Foglio1'[Data])
VAR LatestDateOfMonth =
CALCULATE(
MAX('Foglio1'[Data]),
FILTER(ALL('Foglio1'), MONTH('Foglio1'[Data]) = CurrentMonth && 'Foglio1'[Giacenza] <> BLANK())
)
RETURN
IF('Foglio1'[eomonth] = 1,
DIVIDE(
CALCULATE(
SUM('Foglio1'[Aging]),
'Foglio1'[Data] = LatestDateOfMonth
),
CALCULATE(
SUM('Foglio1'[Giacenza]),
'Foglio1'[Data] = LatestDateOfMonth
),
BLANK()
),
BLANK()
)
```
2. **eomonth**:
```DAX
eomonth =
VAR CurrentMonth = MONTH('Foglio1'[Data])
VAR LatestDateOfMonth =
CALCULATE(
MAX('Foglio1'[Data]),
FILTER(ALL('Foglio1'), MONTH('Foglio1'[Data]) = CurrentMonth && 'Foglio1'[Giacenza] <> BLANK())
)
RETURN
IF('Foglio1'[Data] = LatestDateOfMonth, 1, 0)
```
Make sure to replace `'Foglio1'` with the actual name of your table.
With these modifications, your measures should correctly calculate the aging values for the last day of each month and display them in the matrix even when not drilling down to the "DAY" level.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
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 |
---|---|
95 | |
94 | |
80 | |
71 | |
64 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |