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 All,
Maybe it is a silly question, but I am not able to use a What If Date parameter in a DAX Measure, what I need is to calculate the days between the date parameter and another date field.
The parameter shows up correctly if I put it directly on the table, but when I try to access its value via DAX it retrieves the Minimum Date of the parameter range, the function SELECTEDVALUE doesn't retrieve any value.
Thanks in advance for your help,
Daniel
Thanks @amitchandak, but it is still not working, the parameter and the dax measure have the same code but the last one doesn't evaluate as desired.
Can you help me to understand what am I missing?
@daniel_epc , I am assuming the date parameter table is not joined to another table
You can get min/ max date like this
//Date1 is an independent Date table and Date is Joined
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
Averagex(Table, Datediff(Table[Date], _max, Day)
Thanks @amitchandak , but I still couldn't get it to work, the parameter and the dax measure have the same code but the last one doesn't evaluate as desired.
Thanks in advance,
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |