Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hey Everyone,
I'm having a little trouble with filtering by the maximum value of a month no. and wondering if anyone knows where I'm going wrong.
I have the following formula
Charities (Monthly) = CALCULATE(DISTINCTCOUNT(donation_event[recipient_id]), donation_event[Week No.]=max(donation_event[Week No.]))
Its just to get a distinct count of the recipients when the week no. is equal to the max value for the week no column and I am getting the following error.
"A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Not sure where I'm going wrong as the below works fine too.
Charities (Monthly) = CALCULATE(DISTINCTCOUNT(donation_event[recipient_id]), donation_event[Week No.]=20))
Thanks
Solved! Go to Solution.
Edited
Hi @kirwanm1,
Try this DAX:
Charities (Monthly) = CALCULATE(DISTINCTCOUNT(donation_event[recipient_id]), FILTER(donation_event,donation_event[Week No.]=max(donation_event[Week No.])))
There might some braces missing, just correct that, it should work.
Thanks !!!
Edited
Hi @kirwanm1,
Try this DAX:
Charities (Monthly) = CALCULATE(DISTINCTCOUNT(donation_event[recipient_id]), FILTER(donation_event,donation_event[Week No.]=max(donation_event[Week No.])))
There might some braces missing, just correct that, it should work.
Thanks !!!
Thanks. That works perfectly!
Welcome @kirwanm1
Kindly like the post if you think it has solved your problem 🙂
Table Example
Shop a | 6
Shop a | 6
Shop a | 7
Shop a | 7
Shop b | 5
Shop b | 5
Shop b | 6
Shop b | 6
Shop c | 5
Shop c | 7
Shop c | 7
Shop c | 7
Shop c returns 3
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |