March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I've encountered an issue with a DAX query. I need to show the max month's numbers from the selected values. i.e
if I choose Jun, July and Aug, I should be able to see the sum of value for Aug alone and no other values from other months.
here's the dax I use:
This is the same case if I use any other column in the row.
can anyone help me figure this out to omit the values from other months apart from the max of selected month?
regards,
Mahesh
Solved! Go to Solution.
Hi All,
Fisrtly dharmendars007 thank you for your solutions!
And @Maheshguptaz for your question, this is because in the matrix, there will be a specific calculation environment, in the total column if you can not determine the value of the month of August, they automatically display the value of the month closest to August, we just need to add a filter condition on this basis to complete your needs!
_Close Positions Select Month =
VAR _lastDate =SELECTEDVALUE(example_data[LastDate_Month],MAX('example_data'[LastDate_Month]))
VAR _pos =
CALCULATE(SUM('example_data'[NumberofPositions]),'example_data'[LastDate_Month]=_lastDate)
VAR A=CALCULATE(MAX('example_data'[LastDate_Month]),ALLSELECTED('example_data'))
RETURN
IF(ISINSCOPE('example_data'[Month]),
SUM('example_data'[NumberofPositions]),
IF(A=_lastDate,
_pos,
BLANK()
)
)
Check out my pbix file if you still have questions, I'd be honoured if my answer solves your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi All,
Fisrtly dharmendars007 thank you for your solutions!
And @Maheshguptaz for your question, this is because in the matrix, there will be a specific calculation environment, in the total column if you can not determine the value of the month of August, they automatically display the value of the month closest to August, we just need to add a filter condition on this basis to complete your needs!
_Close Positions Select Month =
VAR _lastDate =SELECTEDVALUE(example_data[LastDate_Month],MAX('example_data'[LastDate_Month]))
VAR _pos =
CALCULATE(SUM('example_data'[NumberofPositions]),'example_data'[LastDate_Month]=_lastDate)
VAR A=CALCULATE(MAX('example_data'[LastDate_Month]),ALLSELECTED('example_data'))
RETURN
IF(ISINSCOPE('example_data'[Month]),
SUM('example_data'[NumberofPositions]),
IF(A=_lastDate,
_pos,
BLANK()
)
)
Check out my pbix file if you still have questions, I'd be honoured if my answer solves your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Maheshguptaz ,
Please try the below measure and let us know if still it doesnt work..
Close Positions Select Month =
VAR LatestMonth =
MAXX(
VALUES('Shared DW_DimDate'[Date].[Month]),
'Shared DW_DimDate'[Date].[Month]
)
VAR Result =
CALCULATE(
SUM('Close Position Report'[NumberofPositions]),
FILTER(
ALLEXCEPT('Close Position Report', 'Close Position Report'[Job Level]),
'Close Position Report'[LastDate_Month] = LatestMonth
)
)
RETURN Result
If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S
Hi @dharmendars007 ,
Thank you for your swift response.
I've tried the DAX that you provided and it still gives the same output.
Regards,
Mahesh
Hi @Maheshguptaz ,
Has your problem been solved after all this time, or has a new problem arisen, if there are any other questions on this issue, feel free to contact me and I'll get back to you as soon as I receive the message.
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
94 | |
89 | |
86 | |
77 | |
49 |
User | Count |
---|---|
164 | |
149 | |
101 | |
73 | |
56 |