Open siufai6 opened 9 months ago
In visualization pane, click "add further analysis to your visual". x-axis and y-axis. click on fx to add average of PL and average of Duration. Then we have the constant lines in scatter chart.
table is a popular pattern in power BI. Basically it's a date dimension (image it as a decode table) that contains ALL dates ! To create... in table view.. add column then there is a DAX formula to create. To allow to create charts like seasonality chart, you can create additional columns like month only (or week only). Then you link it to your FACT table (data table). When creating a viz, drag the date you want (e.g. seasonality chart i just drag the month).. then add e.g. PL (sum, average..etc). Then you created a seasonality chart.
You can have many date columns in one table link to this date dimension table (imagine : stock purchase date, stock sell date).
When you create a visualization.. which one is it using?? the purchase date or the sell date?? it's the "active" relationship one.. I dunno.. may be it's not very useful if you need multiple charts one with purchase date and one with sell date??
I have a table named trades with these cols: code and pl. I would like to summarize average gain and average loss.
CALCULATE ( [avg PL], KEEPFILTERS ( FILTER ( ALL (trades[PL] ), trades[PL] <0 ) ) )
always always remember power BI works with relational table structure (2/13/2024)
If you have data in the form of a complex header (e.g. city, and then product category as column headers),
Power BI cannot use this form of data straight away. you need to convert it into a relational table. like below:
To do this.. you transpose the original data so city and category becomes columns (fields in a table). And then unpivot the year data so that it becomes a de-normalized table ... so columns becomes city, category, year, value.