The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am getting the result but only till the 2022/12 after that the value is showing for the next month is blank I need the value 15736 to display over there. Can you please help ?
Solved! Go to Solution.
Hi, @SupriyaVarun
You can try the following methods.
Column:
Fiscal Month2 = LEFT([Fiscal Month],4)*100+RIGHT([Fiscal Month],2)
Measure:
Pre month SO =
Var _Prevmonth=MAXX(FILTER(ALL('Table'),[Fiscal Month2]<SELECTEDVALUE('Table'[Fiscal Month2])),[Fiscal Month2])
Return
CALCULATE([No of distinct Sales order],FILTER(ALL('Table'),[Fiscal Month2]=_Prevmonth))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sua tabela de data (dCalendar) precisa deste campo:
"Ano Mes Num", YEAR ( [Date] ) * 12 + MONTH ( [Date] ) - 1
Em seguida, fazer esta medida:
Total =
CALCULATE (
[Qtde],
WINDOW (
-1,
REL,
-1,
REL,
ALLSELECTED ( dCalendar[MesAno], dCalendar[Ano Mes Num] )
)
Resultado:
Thank you 🙂
Hi,
Create a Calendar Table with calculated column formulas of FY, Month name and Month number. Sort the Month name by the Month number. Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table. To your visual, drag FY and Month name from the Calendar Table. Write this measure
Measure = calculate([your measure],previousmonth(Calendar[date]))
Hope this helps.
Hi @SupriyaVarun, if you can provide a santized dataset similar to your actual data, it will easy to create a solution and share it with you. You can either give your sample data as an Excel file or PBIX. (Just in case it is okay with you. Else please ignore).
@SupriyaVarun
You can try converting fiscal month by changing it to date format or create date column as below. Then use previous month function.
Let me know if this helps!
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate your kudos!!
Thanks for your help 🙂
But I have used the above measure, it did not work as I needed the values were showing incorrect as per calendar table.
I need the measure using Fiscal month not the calendar month
Use the below logic, Basically when month is 1, it bexomes zero due to -1 and not 12. Also try it with and without the highlighted part(This is to pull out 2022 instead of 2023). Depending on your calendar table sturcture either year - 1 or just year will work.
Prev_ =
VAR CM =
VALUE ( RIGHT ( MAX ( 'SM Dim Calendar'[Fiscal Month] ), 2 ) )
VAR jan =
CALCULATE (
SUM ( SOW[No of disctinct SO#] ),
VALUE ( RIGHT ( 'SM Dim Calendar'[Fiscal Month], 2 ) )
= VALUE (
RIGHT ( FORMAT ( MAX ( 'SM Dim Calendar'[Fiscal Month] ), "YYYY/MM" ), 2 )
) + 11,
'SM Dim Calendar'[Fiscal Year]
= FORMAT ( MAX ( 'SM Dim Calendar'[Date] ), "YYYY" ) - 1
)
VAR Others =
CALCULATE (
SUM ( SOW[No of disctinct SO#] ),
VALUE ( RIGHT ( 'SM Dim Calendar'[Fiscal Month], 2 ) )
= VALUE (
RIGHT ( FORMAT ( MAX ( 'SM Dim Calendar'[Fiscal Month] ), "YYYY/MM" ), 2 )
) - 1,
'SM Dim Calendar'[Fiscal Year]
= FORMAT ( MAX ( 'SM Dim Calendar'[Date] ), "YYYY" )
)
VAR FInal =
IF ( CM = 1, jan, Others )
RETURN
FInal
Let me know if this helps!
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate your kudos!!
The columns i have used Fiscal Month from calendar table,
No of distinct Sales order = DISTINCTCOUNT('SM Fact [Sales Order Number])
Now I need Previous fiscal month sales order only the 2023/01 value is showing blank.
Hi, @SupriyaVarun
You can try the following methods.
Column:
Fiscal Month2 = LEFT([Fiscal Month],4)*100+RIGHT([Fiscal Month],2)
Measure:
Pre month SO =
Var _Prevmonth=MAXX(FILTER(ALL('Table'),[Fiscal Month2]<SELECTEDVALUE('Table'[Fiscal Month2])),[Fiscal Month2])
Return
CALCULATE([No of distinct Sales order],FILTER(ALL('Table'),[Fiscal Month2]=_Prevmonth))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @SupriyaVarun
Can you try to add Allselected(table,table[fiscal month]) in you filters, If this doesn't make a change please share a sample data with all the columns used in the table visual.
Let me know if this helped.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate your kudos!!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
79 | |
71 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
71 | |
64 | |
58 |