Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I don't have experience with DAX and I'm trying to understand a DAX which is used in a workbook.
Here is the link to workbook. https://community.tableau.com/servlet/JiveServlet/download/847360-289331/SampleData.xlsx
This is the formula which is used to calculate earned exposure.
=SUMX ( SUMMARIZE ( Table2, Table2[InceptionDate], Table2[ExpiryDate], "Earned Exposure", COUNTA(Table2[Policy Name]) * COUNTROWS ( CALCULATETABLE ('Table1', KEEPFILTERS( DATESBETWEEN ( Table1[DateKey],Table2[InceptionDate], Table2[ExpiryDate] ) ) ) ) / COUNTROWS ( DATESBETWEEN ( Table1[DateKey],Table2[InceptionDate], Table2[ExpiryDate] ) ) ), [Earned Exposure] )
Please help me to understand how earned exposure is calculated in Sheet1 for each month using above formulae.
Month | Earned Exposure |
1 | 0.855191257 |
2 | 0.765027322 |
3 | 0.846994536 |
Regards,
Ombir
Solved! Go to Solution.
Hi @Anonymous,
Description of formula segmentation:
SUMMARIZE ( Table2, Table2[InceptionDate], Table2[ExpiryDate],"Earned Exposure",expressions)
Summarize table based on two date columns and add custom column with following expressions.
COUNTA(Table2[Policy Name])
Calculate related 'policy name' count based on summarize columns.
COUNTROWS (CALCULATETABLE ('Table1',KEEPFILTERS (DATESBETWEEN ( Table1[DateKey], Table2[InceptionDate], Table2[ExpiryDate] ))))
Filtered table1 row count based condition 'datekey' field in date range which defined by current row 'InceptionDate' and 'ExpiryDatefunction'.
COUNTROWS ( DATESBETWEEN ( Table1[DateKey], Table2[InceptionDate], Table2[ExpiryDate] ) )
Filtered datekey fields count in current date range.
SUMX (SummarizeTable,[Earned Exposure])
Get summarize of new column based on category fields in table visual.
Regards,
Xiaoxin Sheng
Hi @Anonymous,
Description of formula segmentation:
SUMMARIZE ( Table2, Table2[InceptionDate], Table2[ExpiryDate],"Earned Exposure",expressions)
Summarize table based on two date columns and add custom column with following expressions.
COUNTA(Table2[Policy Name])
Calculate related 'policy name' count based on summarize columns.
COUNTROWS (CALCULATETABLE ('Table1',KEEPFILTERS (DATESBETWEEN ( Table1[DateKey], Table2[InceptionDate], Table2[ExpiryDate] ))))
Filtered table1 row count based condition 'datekey' field in date range which defined by current row 'InceptionDate' and 'ExpiryDatefunction'.
COUNTROWS ( DATESBETWEEN ( Table1[DateKey], Table2[InceptionDate], Table2[ExpiryDate] ) )
Filtered datekey fields count in current date range.
SUMX (SummarizeTable,[Earned Exposure])
Get summarize of new column based on category fields in table visual.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |