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.
Currently I am able to create this for a card :
DateText = IF(AND(SELECTEDVALUE(PERIOD_DIM[MTH],"All") ="All", SELECTEDVALUE(PERIOD_DIM[YR],"All")="All"),(MIN(PERIOD_DIM[MTH]) & "/" & MIN(PERIOD_DIM[YR]) &" - " & MAX(PERIOD_DIM[MTH]) & "/" & MAX(PERIOD_DIM[YR])),(SELECTEDVALUE(PERIOD_DIM[MTH],"All") & "-" & SELECTEDVALUE(PERIOD_DIM[YR],"All")))
However, the max month in my table is Sep of this year. I need to limit it to the previous month. I also want the slicer that is a Hierarchy Slicer built on MTH and YR to default to the previous month and year. That would then populate in the card. Is that possible?
Solved! Go to Solution.
I solved it with this:
I solved it with this:
@snoh8r49 , you need a column like this in your date table
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1*month(Today())),"Last year Last Month" ,
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)
or
Month Type =
var _today = max(Fact[Date])
Switch( True(),
eomonth([Date],0) = eomonth(_today ,-1*month(_today )),"Last year Last Month" ,
eomonth([Date],0) = eomonth(_today ,-1),"Last Month" ,
eomonth([Date],0)= eomonth(_today ,0),"This Month" ,
Format([Date],"MMM-YYYY")
)
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 |
---|---|
108 | |
106 | |
86 | |
77 | |
69 |
User | Count |
---|---|
124 | |
112 | |
94 | |
84 | |
75 |