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.
Good day all,
I am sure I am simply not finding the right function to accomplish this (or search on).
I have a simple % change measure that goes into a Visual Table.
Hi @TrentS
You could do something below which will look at the Max Date which is selected from the date table and then work out the previous month based on the Date selection
Previous Month Selection =
VAR MaxDateBlank =
MAX( 'Date'[Date] )
// THis checks to see if the MAX Date from the Bet Table is blank for a particular row
// If it is blank then use the MaxDateBlank from above to put in a DATE Value.
// Otherwise the value for the Date will be blank which will break the LastDateDone
VAR MAxBetDate =
IF(
ISBLANK( MAX( 'Sales'[DayMarker] ) ),
MaxDateBlank,
MAX( 'Sales'[DayMarker] )
)
VAR PrevMthStartDate =
DATE ( YEAR ( MAxBetDate ), MONTH ( MAxBetDate ) - 1, 1 )
VAR PrevMthEndDate =
DATE ( YEAR ( MAxBetDate ), MONTH ( MAxBetDate ) - 1, DAY ( MAxBetDate ) )
RETURN
CALCULATE (
[Sales Value],
FILTER (
'Date',
'Date'[Date] >= PrevMthStartDate
&& 'Date'[Date] <= PrevMthEndDate
)
)
Thanks for the reply Gilbert. Kudos given.
The Time Intelligence functions here don't seem to be an issue. It is more about having the measure ignore a field that is being added to the visual Table (and is a set column in the data table).
If I remove the new column from the visual, all rows populate correctly for that measure. With the column in the visual, only rows where that column is the same as the previous month populate.
In the example above, all four rows are for the same Product with different months (Oct-Jan). The bottom two rows have different values for that new column. (A product specification changes).
If I remove that new column all four rows populate with the values for the % change.
Keep the suggestions coming, please!
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 |
---|---|
58 | |
20 | |
19 | |
18 | |
9 |