A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
Understanding the CURRENTGROUP function
The CURRENTGROUP function is used to return a table that contains all the rows within the current group. In other words, if you have a table that is grouped by a certain column, the CURRENTGROUP function will return all the rows that belong to the current group.
For example, let’s say you have a table that contains sales data for different regions. If you group the data by region, the CURRENTGROUP function will return all the rows that belong to the current region. This is particularly useful when you want to perform calculations on a subset of data within a group.
Syntax
The syntax for the CURRENTGROUP function is as follows:
CURRENTGROUP([column1], [column2], …)
The function takes one or more columns as arguments and returns a table containing all the rows within the current group. If no arguments are provided, the function will return all the columns in the current group.
Using CURRENTGROUP in Power BI
To use the CURRENTGROUP function in Power BI, follow these steps:
1. Create a table visual in Power BI.
2. Group the table by one or more columns.
3. Create a calculated column using the CURRENTGROUP function.
For example, let's say you have a table that contains sales data for different regions, and you want to calculate the percentage of total sales for each region. Here's how you can do it using the CURRENTGROUP function:
1. Create a table visual in Power BI.
2. Group the table by the "Region" column.
3. Create a calculated column using the following DAX formula:
Sales Percentage = [Sales] / SUMX(CURRENTGROUP(), [Sales])
This formula will divide the sales for each region by the total sales for the current group (i.e., all the regions).
The CURRENTGROUP function is a powerful tool that can be used to perform calculations on subsets of data within a group. It is particularly useful when working with large datasets and can help you generate insights quickly and easily. By following the steps outlined in this article, you can start using the CURRENTGROUP function in your own Power BI reports and dashboards.