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.
Hello,
I need to retrieve the MAX per PN M by month. I currently have the below measure, but it is not retriving the correct value. It is retrieving the MAX value per date. The desired output is 81 and not 80.
Could you please assist me?
Thank you!
Barbara
Solved! Go to Solution.
Hi @ABLRP,
I modify the formula to use both year and month fields as conditions(based on current row date), you can try it if helps:
MAX DEMAND =
VAR currDate =
MAX ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] )
RETURN
CALCULATE (
MAX ( 'INVENTORY HISTORY'[QTY] ),
FILTER (
ALLSELECTED ( 'INVENTORY HISTORY' ),
'INVENTORY HISTORY'[TRANSACTION_TYPE] = "ISSUED"
&& YEAR ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] )
= YEAR ( currDate ) - 1
&& MONTH ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] ) = MONTH ( currDate )
)
)
Regards,
Xiaoxin Sheng
Hi @ABLRP,
I modify the formula to use both year and month fields as conditions(based on current row date), you can try it if helps:
MAX DEMAND =
VAR currDate =
MAX ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] )
RETURN
CALCULATE (
MAX ( 'INVENTORY HISTORY'[QTY] ),
FILTER (
ALLSELECTED ( 'INVENTORY HISTORY' ),
'INVENTORY HISTORY'[TRANSACTION_TYPE] = "ISSUED"
&& YEAR ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] )
= YEAR ( currDate ) - 1
&& MONTH ( 'INVENTORY HISTORY'[TRANSACTION CREATED_DATE] ) = MONTH ( currDate )
)
)
Regards,
Xiaoxin Sheng
@ABLRP , Create a measure like below, Use month in place of date if need, create a column for month
maxx(summzarize(Table, Table[PN I], Table[Transaction_created_date], "_1", Sum(Table[Qty])), [_1])
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |