Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
am using below dax to pass a date selection from query 1 date table into the dax custom column, but it seems like the selection is not working, how can I manage to do this:
Hi @Anmolgan
try a measure
Measure =
var reference_date= SELECTEDVALUE(Query1[FullDateAlternateKey])
return
STARTOFMONTH(reference_date)
or column
Column1 =
var reference_date= CALCULATE(MAX(Query1[FullDateAlternateKey]))
return
STARTOFMONTH(reference_date)
@az38
can I not use this in a custom column? I have a datediff formula date works on the basis of this dax and that goes like this:
@az38 so I am trying to calculate aging bucket on the basis of selection of a date field:
I have a custom column where I convert any selected that to 1st of each month, need to figure out how can I use custom column here:
see my post above.
your Month Measure will look like
Month =
var _effDate = MAX(pcc_view_ar_aging[effective_date])
RETURN
DATEDIFF(_effDate , [Measure], MONTH)
Your New aging bucket measure will be similar with
New aging bucket =
var _Month = [Month]
var _effDate = MAX(pcc_view_ar_aging[effective_date])
RETURN
SWITCH(TRUE(),
MONTH(_effDate) = MONTH([Measure11]) && YEAR(_effDate) = YEAR([Measure11]) && _effDate <= TODAY(), "Current",
_Month > 0 && _Month <= 12, CONCATENATE(30 * _Month, " Days"),
"greater than current month aging"
)
@az38 I did not understand this line can you explain a bit, so that I can built the bucket and validate with the actual one in my column.
if you need your visual reacts to slicer you need to create a Measure and not a Column.
I do not completely understand your business logic, as I do not see any examples of data and desired result both. So, I Can not be sure in the correct statements for you
@az38 I have attached an output screenshot of what I am getting when I am creating my bucket and passing a hardcoded date to refersh date, please view the screenshot:
you are trying to implement what-if logic which described here https://docs.microsoft.com/en-us/power-bi/desktop-what-if
it will work with measure
try to re-write your formula as a Measure
Month =
var _effDate = MAX(pcc_view_ar_aging[effective_date])
RETURN
DATEDIFF(_effDate , [Measure], MONTH)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |