Power BI notes

Posted by John Liu on Friday, December 23, 2022

Number formatting

“#,0.00” two decimal with thousand separator

“#,0” no decimal with thousand separator

“#,#” no decimal with thousand separator

“P0” no decimal point

“P2” 2 decimal points

Workout the first day of the week based on sepecified day

=DateAdd(DateInterval.Day
    ,1
    ,DateAdd(DateInterval.Day
            ,DatePart(DateInterval.WeekDay
                    ,iif(IsNothing(Parameters!ReportDate.Value),Today(),Parameters!ReportDate.Value)
                    ,FirstDayOfWeek.Sunday
                    )  * -1
            ,iif(IsNothing(Parameters!ReportDate.Value),Today(),Parameters!ReportDate.Value)
            )
    )