The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi People.
I need a measure doing the following depending on what I select on a slicer:
When I select multiple values: Return "Multiple"
When I select no value: Return "No"
When I select a single value (1): Return Last Date
Column which gets filtered in slicer:
2021-01
2021-02
2021-03
I have created the following measure for this:
Do you have an solution or new measure for this?
Solved! Go to Solution.
Hi @lynnsop ,
I checked your formula, there is no problem in import mode. It should be noted that the [Actual Date] column needs to be in date format.
If your data source connection mode is direct query, it may cause this problem. It is recommended that you rewrite measure as:
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lynnsop ,
Is this problem has been solved?
If the problem persists, please share a sample pbix with dummy data.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I found a workaround for that so I dont have to use that "complex" DAX. Thanks for your help and time! 🙂
Hi @lynnsop ,
I checked your formula, there is no problem in import mode. It should be noted that the [Actual Date] column needs to be in date format.
If your data source connection mode is direct query, it may cause this problem. It is recommended that you rewrite measure as:
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@lynnsop , Try if that can help
countx(allselected('KPIs Summary'[Actual Date]),filter( 'KPIs Summary', 'KPIs Summary'[Actual Date] >1 && 'KPIs Summary'[Actual Date] = LASTDATE('KPIs Summary'[Actual Date])))
or
meausre =
var _max = maxx(allselected('KPIs Summary', 'KPIs Summary'[Actual Date])
return
countx(allselected('KPIs Summary'[Actual Date]),filter( 'KPIs Summary', 'KPIs Summary'[Actual Date] >1 && 'KPIs Summary'[Actual Date] = LASTDATE('KPIs Summary'[Actual Date])))
@lynnsop , Sorry, My mistake.
Try if these can work
countx(filter(allselected('KPIs Summary'[Actual Date]), 'KPIs Summary'[Actual Date] >1 && 'KPIs Summary'[Actual Date] = LASTDATE('KPIs Summary'[Actual Date])),
'KPIs Summary'[Actual Date])
measure =
var _max = maxx(allselected('KPIs Summary', 'KPIs Summary'[Actual Date])
return
countx(allselected('KPIs Summary'[Actual Date]),filter( 'KPIs Summary', 'KPIs Summary'[Actual Date] >1 && 'KPIs Summary'[Actual Date] = LASTDATE('KPIs Summary'[Actual Date]))
, 'KPIs Summary'[Actual Date])
@amitchandak
Still not working 😞
1st is just showing me the amount of filters I selected regardless of if i combine it with my switch:
2nd:
Even when I fix the ) in MAXX Function