Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |