Posts

Daily DAX : Day 461 TOTALWTD

TOTALWTD – Week-to-Date Total TOTALWTD is a DAX time-intelligence function in Power BI that calculates the cumulative total (running total) from the start of the week up to the current date in context. Syntax TOTALWTD( <expression>, <dates> [,<filter>] ) Parameters <expression> → usually an aggregation like SUM(Sales[Amount]) <dates> → reference to your date column (e.g. 'Calendar'[Date] ) [<filter>] → optional additional filter (rarely used) Important Requirements The table containing <dates> must be marked as a Date table in Power BI Week starts on Sunday by default (standard ISO-like week behavior in most cases) Does not work reliably in DirectQuery mode for calculated columns / RLS Common Use Cases 1. Week-to-date Sales WTD Sales = TOTALWTD( SUM(Sales[Amount]), 'Calendar'[Date] ) → Shows sales from Monday (or Sunday) until the selected day. 2....

Daily DAX : Day 460 ISINTEGER

DAX Function: ISINTEGER Purpose: Checks if a value is a whole number (integer) → returns TRUE or FALSE Syntax ISINTEGER ( <value> ) Parameters Parameter Description <value> The value to test (can be a number, column reference, expression...) Returns TRUE → value is a whole number (..., -2, -1, 0, 1, 2, 42, ...) FALSE → value has decimal places, is text, blank, etc. Important: ISINTEGER is just another name for ISINT64 . It checks for whole numbers — not whether the value is numeric in general. (Use ISNUMBER if you want to check "is this any kind of number?") Simple Examples Direct values: ISINTEGER( 42 ) → TRUE ISINTEGER( 0 ) → TRUE ISINTEGER( -17 ) → TRUE ISINTEGER( 3.0 ) → TRUE (3.0 is mathematically an integer) ISINTEGER( 3.1 ) → FALSE ISINTEGER( "42" ) → FALSE (text is not integer) ISINTEGER( BLANK() ) → FALSE Realistic Use Cases ...

Daily DAX : Day 459 OPENINGBALANCEWEEK

OPENINGBALANCEWEEK – DAX Function Purpose: Returns the value of an expression calculated at the end of the previous week (i.e. the opening balance position carried into the current week). Syntax (2025+ calendar-based version) OPENINGBALANCEWEEK( <expression>, <calendar> [,<filter>] ) Parameters expression → usually a measure like SUM(Sales[Amount]) or SUMX(Inventory, [Value]) calendar → reference to your calendar table (must have date column marked as Date table) filter (optional) → additional filter context (rarely used) What it really returns The value your measure had on the last day of the previous week. → Monday's opening balance = Sunday's closing balance (of the prior week) Typical Use Cases Opening inventory / stock value at the start of each week Opening cash / bank balance before weekly transactions Carried-forward arrears / backlog at week start Week-to-date change calculation : ...

Daily DAX : Day 458 INFO.VIEW.RELATIONSHIPS

INFO.VIEW.RELATIONSHIPS( ) What it does: Returns a table containing detailed metadata about every relationship defined in your current Power BI semantic model. Syntax INFO.VIEW.RELATIONSHIPS() No parameters – just call it as is. Typical usage (as a calculated table) Model Relationships = INFO.VIEW.RELATIONSHIPS() Most useful columns returned Column Type Description ID Integer Unique numeric ID of the relationship From Table String Name of the "many" side table From Column String Column name used on the many side To Table String Name of the "one" side table To Column String Column name used on the one side CrossFilteringBehavior String Single / Both / Automatic IsActive Boolean Is this relationship currently active? FromCardinality / ToCardinality String * → 1, 1 → 1, etc. RelyOnReferentialIntegrity Bo...

Daily DAX : Day 457 INFO.VIEW.MEASURES

INFO.VIEW.MEASURES – Power BI DAX Function Introduced: ~October 2024 Purpose: Returns a table containing metadata about all measures in your current semantic model (Power BI dataset). Syntax INFO.VIEW.MEASURES ( ) No parameters – super simple! What Columns Does It Return? Column Name Data Type Description ID Integer Internal ID of the measure Name String Measure name (what you see in the Fields pane) Table String Name of the home table where the measure lives Description String Description (if filled in) DataType String Result data type (e.g. Decimal, Integer, ...) Expression String The actual DAX code of the measure FormatString String Current / static format string ...

Daily DAX : Day 456 ISDATETIME

DAX Function ISDATETIME  In Power BI, ISDATETIME is an Information function in DAX used to validate whether a specific value or expression results in a DateTime data type. It is essentially a "safety check" for your data logic, ensuring that the input you are passing into other functions is actually a date or time before you try to calculate something with it. 1. Syntax and Return Value The syntax is straightforward: ISDATETIME(<value>)     • Value: Any DAX expression or column reference you want to check.     • Returns: A Boolean value—TRUE if the value is a date/time; FALSE otherwise. 2. Key Use Cases While Power BI usually handles data types automatically, ISDATETIME becomes critical in scenarios where data is "dirty" or polymorphic (mixed types). A. Data Validation in Conditional Logic If you have a column that might contain mixed data (like a "Notes" column where some entries are dates and others are text), you can use ISDATETIME to prevent your...

Daily DAX : Day 455 ISNUMERIC

DAX ISNUMERIC / ISNUMBER Both functions do the same thing — Microsoft calls them aliases. What they do Returns TRUE if the value is a number, otherwise FALSE . Syntax ISNUMERIC ( <value> ) ISNUMBER ( <value> ) You can use either name — result is identical. Simple examples ISNUMBER( 42 ) → TRUE ISNUMBER( 3.14 ) → TRUE ISNUMBER( -500 ) → TRUE ISNUMBER( "123" ) → FALSE (it's text) ISNUMBER( "abc" ) → FALSE ISNUMBER( BLANK() ) → FALSE ISNUMBER( TODAY() ) → TRUE (dates are numeric in DAX) ISNUMBER( 1/1/2025 ) → TRUE Most common real-world use cases Clean dirty imported data (mixed text + numbers) Safe Number = IF( ISNUMBER( Sales[Amount Text] ), VALUE( Sales[Amount Text] ), BLANK() ) Conditional formatting / flags Is Numeric Flag = IF( ISNUMBER( Data[Column] ), "Number ✓", "Text / Error ✗" ) ...