Forum Discussion
mick22
4 years agoFrequent Visitor
How would I do a dynamic visualization to show for Current and Next 12 Months Total Sales.
I have a main table dataset (Table 2 below) that is imported in to PowerBI Desktop that contains a list of customers, agreements, the current monthly price and date range of how long that agreement g...
- Anonymous4 years ago
Hi mick22 ,
Here are the steps you can follow:
1. Create calculated table2.
Table2:
Table 2 =
CALENDAR(MIN('Table'[StartDate]),MAX('Table'[EndDate]))
Create the calculated column in Table2:
Year1 = VALUE( FORMAT('Table 2'[Date],"yyyymm"))Year2 = VALUE( FORMAT('Table 2'[Date],"yyyymm"))2. Create calculated table3.
Table3:
Table 3 = DISTINCT('Table 2'[Year2])3. Create measure.
Flag = var _1=CALCULATE(SUM('Table'[CurrentMonthlyPrice]),FILTER(ALL('Table 2'),'Table 2'[Year1]>=VALUE( FORMAT(MAX('Table'[StartDate]),"yyyymm"))&&MAX('Table 3'[Year2])<=VALUE( FORMAT(MAX('Table'[EndDate]),"yyyymm")))) return IF( MAX('Table 3'[Year2])<=MAX('Table 2'[Year1]),_1 ,0)Total_Incorrect = var _table=SUMMARIZE('Table 2','Table 2'[Year1],"_value",[Flag]) return IF(HASONEVALUE('Table 2'[Year1]),[Flag],SUMX(_table,[_value]))4. Result:
Refer to:
https://community.powerbi.com/t5/Desktop/Create-Lower-Triangular-Matrix/m-p/854339
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Ashish_Mathur
4 years agoSuper User
You are welcome. In the Column labels, you should drag Year and Month name from the Calendar_dup table.
If my previous reply helped, please mark that reply as Answer.
mick22
4 years agoFrequent Visitor
I did that previously but they still didn't come through.
- Ashish_Mathur4 years agoSuper User
I cannot help unless i see your file.