Sunday, December 24, 2017
Wednesday, December 13, 2017
Simple DAX on Power BI
DAX
Sum with applying a filter
Total for Non Duplicate =
CALCULATE(
SUM('InvoiceDetails'[Total]),
'InvoiceDetails'[DuplicateInvoice] IN { FALSE }
)
Total for Non Duplicate 2 =
SUMX(
FILTER(InvoiceDetails,InvoiceDetails[DuplicateInvoice] = FALSE ),
InvoiceDetails[Total])
Handle null value in SUM/ COUNT
Exception Value =
VAR total=SUM(InvoiceStatusView[EXCEPTION])
RETURN IF(ISBLANK(total),0,total)
Exception Count =
VAR total=COUNT(InvoiceStatusView[EXCEPTION])
RETURN IF(ISBLANK(total),0,total)
Sum with applying a filter
Total for Non Duplicate =
CALCULATE(
SUM('InvoiceDetails'[Total]),
'InvoiceDetails'[DuplicateInvoice] IN { FALSE }
)
Total for Non Duplicate 2 =
SUMX(
FILTER(InvoiceDetails,InvoiceDetails[DuplicateInvoice] = FALSE ),
InvoiceDetails[Total])
Handle null value in SUM/ COUNT
Exception Value =
VAR total=SUM(InvoiceStatusView[EXCEPTION])
RETURN IF(ISBLANK(total),0,total)
Exception Count =
VAR total=COUNT(InvoiceStatusView[EXCEPTION])
RETURN IF(ISBLANK(total),0,total)
Tuesday, December 5, 2017
All Tables Row Count
All Tables Row Count
SELECT T.name AS [TABLE NAME],
I.rows AS [ROWCOUNT]
FROM sys.tables AS T
INNER JOIN sys.sysindexes AS I
ON T.object_id = I.id
AND I.indid < 2
ORDER BY I.rows DESC
Subscribe to:
Posts (Atom)