30/09/2024
๐๐๐ (๐๐๐ญ๐ ๐๐ง๐๐ฅ๐ฒ๐ฌ๐ข๐ฌ ๐๐ฑ๐ฉ๐ซ๐๐ฌ๐ฌ๐ข๐จ๐ง๐ฌ)
---------------------------------------
is a powerful language used in Power BI for creating custom calculations in your data models. DAX is essential for creating calculated columns, measures, and calculated tables, which are necessary for advanced analysis and insights.
๐. ๐๐๐ฌ๐ข๐ ๐๐๐ ๐
๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ:
SUM(), AVERAGE(), COUNT(), etc.
These are the most common aggregate functions used in Power BI.
๐. ๐๐๐ฅ๐๐ฎ๐ฅ๐๐ญ๐๐ ๐๐จ๐ฅ๐ฎ๐ฆ๐ง๐ฌ ๐ฏ๐ฌ. ๐๐๐๐ฌ๐ฎ๐ซ๐๐ฌ:
Calculated Columns: These are calculated at the row level and stored in the model. Ideal for new columns based on existing ones.
Measures: Calculated on the fly based on the context of the visual (i.e., theyโre dynamic). This is where DAX shines for more complex calculations like totals, percentages, etc.
๐. ๐
๐ข๐ฅ๐ญ๐๐ซ๐ข๐ง๐ ๐
๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ:
FILTER(), ALL(), ALLEXCEPT(), CALCULATE()
These are used to modify the filter context in which calculations occur.
๐. ๐๐ข๐ฆ๐ ๐๐ง๐ญ๐๐ฅ๐ฅ๐ข๐ ๐๐ง๐๐ ๐
๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ:
DATEADD(), DATESYTD(), SAMEPERIODLASTYEAR(), etc.
These functions help you work with dates, such as calculating year-over-year growth or month-to-date totals.
๐. ๐๐จ๐ง๐ญ๐๐ฑ๐ญ:
Row Context: This is created when you calculate a calculated column or use row-based calculations.
Filter Context: Created when visualizations are applied to the data, such as filtering by a specific region or product.