Posts

Daily DAX : Day 468 STARTOFWEEK

DAX Function: STARTOFWEEK STARTOFWEEK returns a table containing the first date of the week in the current filter context, according to a properly marked calendar table. Syntax STARTOFWEEK ( <calendar> ) <calendar> = name of your date/calendar table (must be marked as date table in Power BI) Return Value A single-row table with: All primary tagged columns (usually Date) All other time-intelligence related columns from your calendar Important: This is a time-intelligence function. → Requires a proper calendar table marked as Date table → Works with calendar (not fiscal) week logic in recent versions Common Use Cases Week-to-date (WTD) calculations WTD Sales = CALCULATE( [Total Sales], DATESBETWEEN( 'Calendar'[Date], STARTOFWEEK('Calendar'), LASTDATE('Calendar'[Date]) ) ) Compare current week vs previous week Sales same week last year = CALCULATE( [Total Sales...

Daily DAX : Day 467 PREVIOUSWEEK

DAX Function: PREVIOUSWEEK Purpose: Returns a table with all dates from the previous week (relative to the first date in the current context). Syntax PREVIOUSWEEK ( <Calendar> ) <Calendar> = reference to your date/calendar table (must be properly marked as date table or used in enhanced time intelligence mode) Important Requirements You need a proper Date / Calendar table Best used with Enhanced DAX Time Intelligence (preview feature → now more widely available) Usually combined with CALCULATE Most Common Use Case Compare this week vs previous week (week-over-week analysis) Typical pattern – Previous Week Sales: Previous Week Sales = CALCULATE( [Total Sales], PREVIOUSWEEK( 'Calendar' ) ) Other useful variations: -- Previous week margin % Previous Week Margin % = DIVIDE( CALCULATE([Total Margin], PREVIOUSWEEK('Calendar')), CALCULATE([Total Sales], PREVIOUSWEEK('Calendar')) ) -- WoW % c...

Daily DAX : Day 466 NATURAL.JOINUSAGE

The DAX function NATURALJOINUSAGE  This is a specialized, mostly undocumented table manipulation function. Based on the documentation from DAX Guide, it is not intended for standard report authoring but serves a specific role in complex data architectures. Explanation of NATURALJOINUSAGE The function is used to add a table as a Natural Join into the filter context. Unlike common join functions like NATURALINNERJOIN, which return a physical-style table result, NATURALJOINUSAGE acts as a value filter within specific query structures. Key Characteristics:     Restriction: It can only be used as a value filter within the SUMMARIZECOLUMNS function.     Internal Purpose: It is primarily intended for internal use by the Power BI engine. Composite Models: It is specifically designed to handle queries sent to remote semantic models within a Composite Model (where one Power BI model connects to another Power BI dataset or Analysis Services model).      Non-...

Daily DAX : Day 465 ISDECIMAL

DAX ISDECIMAL Function ISDECIMAL checks if a value has the decimal number data type in Power BI (also known as fixed-precision decimal / currency type). Syntax ISDECIMAL ( <value> ) Parameter Description <value> The expression or column value to test Return Value TRUE → value is a decimal number (fixed decimal / Currency type) FALSE → value is anything else (whole number, float/double, text, date, blank, etc.) Important Notes ISDECIMAL is just another name (alias) for ISCURRENCY In Power BI, "Decimal Number" usually means floating point (Double), while Fixed Decimal Number = Currency type = what ISDECIMAL detects Not supported in DirectQuery mode (calculated columns or RLS rules) Common Use Cases 1. Clean mixed imported data (most common real-world use) ValidCurrency = IF( ISDECIMAL ( 'Sales'[Amount Imported] ), 'Sales'[Amount Imported], BLANK() ) → Only keeps...

Daily DAX : Day 464 ISDOUBLE

Power BI DAX Function ISDOUBLE  The ISDOUBLE function in Power BI (DAX) is a relatively straightforward but essential information function. Its primary purpose is to check whether a value or an expression results in a Double (a double-precision floating-point) data type. How it Works The function returns a simple Boolean value:     • TRUE: If the value is a Double (decimal number).     • FALSE: If the value is any other data type (String, Integer, Date, Boolean, etc.). Syntax ISDOUBLE(<value>) Why use ISDOUBLE? In DAX, "Double" is the data type used for Decimal Numbers. While it might seem obvious what a number is, DAX distinguishes between Integers (whole numbers) and Doubles (numbers with potential decimals). Key Use Cases     • Data Validation: Before performing complex scientific or financial calculations that require high precision, you can use ISDOUBLE to ensure the input data is in the correct format.     • Conditional Logic in M...

Daily DAX : Day 463 INFO.VIEW.TABLES

DAX Function: INFO.VIEW.TABLES() INFO.VIEW.TABLES is a DAX function in Power BI (introduced around late 2024) that returns a table containing metadata about all tables in your semantic model.It is part of the more user-friendly INFO.VIEW family of functions (compared to the older INFO.* functions), and — crucially — can be used inside calculated tables, measures, and columns (unlike most plain INFO functions). Main Use Case The primary and most powerful use case is automatic model self-documentation. You create one or more calculated tables that list: All tables in the model Their properties (name, description, storage mode, whether it's a calculated table, calculation group, date table, etc.) Hidden/visible status, row count hints, etc. → The documentation stays up-to-date automatically every time the model refreshes. Very useful for: Large team / enterprise models Handover to other developers Governance & auditing Training new team members Finding hidden/orphaned tables Qui...

Daily DAX : Day 462 ISINT64

DAX ISINT64 Function ISINT64 checks whether a value is a whole number (integer) that fits in a 64-bit integer format. It returns: TRUE → value is an integer (no decimal part) FALSE → value has decimal places, is text, blank, date, etc. Important: ISINT64 is just another name (alias) for ISINTEGER . Microsoft recommends using ISINTEGER in most cases. Syntax ISINT64 ( <value> ) Parameter Description <value> The value / expression / column to test Basic Examples // Returns TRUE ISINT64( 42 ) ISINT64( -17 ) ISINT64( 0 ) // Returns FALSE ISINT64( 3.14 ) // decimal ISINT64( "123" ) // text ISINT64( BLANK() ) // blank ISINT64( TODAY() ) // date Realistic Use Cases (2025–2026) Flexible User-Defined Functions (UDFs – Preview feature) // Modern DAX UDF pattern (very common since 2025) FUNCTION GetNameOrId = ( input ) => IF ( ISINT64 ( input ), ...