Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi All,
Im trying to get a value coming from the previous month on the same table,
I tried the following, but always got blank results.
IDFDate = ID and Current Month
IDPMFDATE = ID and Previous Month
any idea why its showing as blank?
Solved! Go to Solution.
Hi @Lobs ,
FILTER ( ALL ( Roster ), Roster[IDFDATE]= Roster[IDPMFDATE] )
The problem may be in this filter condition.
Please try this:
Column = CALCULATE(FIRSTNONBLANK(Roster[Segments_],1),FILTER(Roster,EARLIER(Roster[IDFDATE])=Roster[IDFDATE]&&Roster[IDPMFDATE] IN VALUES(Roster[IDFDATE])))
If segment is obtained by month, create two columns respectively to represent the current month and previous month, and the formula is similar to the above.
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 @Lobs ,
FILTER ( ALL ( Roster ), Roster[IDFDATE]= Roster[IDPMFDATE] )
The problem may be in this filter condition.
Please try this:
Column = CALCULATE(FIRSTNONBLANK(Roster[Segments_],1),FILTER(Roster,EARLIER(Roster[IDFDATE])=Roster[IDFDATE]&&Roster[IDPMFDATE] IN VALUES(Roster[IDFDATE])))
If segment is obtained by month, create two columns respectively to represent the current month and previous month, and the formula is similar to the above.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Lobs , not very clear, But you should use time intelligence with date table example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Thanks Amit, what if i wanted to show just a Value (in this case a Letter) what expression can i use?
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
165 | |
83 | |
68 | |
68 | |
59 |