Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I would like to show the "Number of Materials" up to the current day/month/year (depending on selection).
For this, I used the following DAX formula:
Materials =
CALCULATE (
DISTINCTCOUNT ( MaterialsFact[CiceroId] ),
NOT ( MaterialsFact[State] IN { "DISCARDED", "CLOSED_ILL" } )
)
Materials Previous Date =
VAR FirstVisibleDate =
MIN ( 'DateDim'[Id])
VAR PreviousOrderDate =
CALCULATETABLE (
LASTNONBLANK (
'DateDim'[FullDate],
[Materials]
),
'DateDim'[FullDate] < FirstVisibleDate
)
VAR Result =
CALCULATE (
[Materials],
PreviousOrderDate
)
RETURN
Result
Unfortunately the total amount (see the value for January or 2022) is not displayed correctly before I expand the hierarchy: (see the image below)
I mention that there are 2 tables. DateDim and MaterialsFact and the relationship is between: DateDim[Id] = MaterialsFact[DateId](integers data type).
It works ok when I use the Id column from DateDim BUT I would like to use the "FullDate" column in the Visual(Matrix).
Do you think you can help me with this problem?
Thanks! 🙂
Solved! Go to Solution.
@Anonymous , Change the return of second one like this and try
return
sumx(values('Date'[Date]), Result)
@Anonymous , Change the return of second one like this and try
return
sumx(values('Date'[Date]), Result)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
84 | |
84 | |
73 | |
49 |
User | Count |
---|---|
143 | |
132 | |
110 | |
65 | |
55 |