Forum Discussion
suryamanoj52
3 years agoNew Member
Power BI DAX
Hi, I have two columns Date and Total Sales. Now I need to split the Total Sales column into 3 columns. First is based on selected month and year I need total sales upto previous Financial year end...
Ashish_Mathur
3 years agoSuper User
Hi,
You have not specified the FY so i have assumed that it is Jan - Dec. Try this process
- Create a Calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number
- Create a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar table
- To your slicer, drag Year and Month name from the Calendar Table and select any oen Year and Month name
- Write these measures
Total sales = sum(Data[Sales])
Total sales in previous FY = calculate([Total sales],previousyear(calendar[date]))
Total sales in present FY = calculate([Total sales],datesbetween(calendar[date],date(year(min(calendar[date]),1,1)),min(calendar[date])-1))
Hope this helps.