GithubHelp home page GithubHelp logo

tomaztk / dax_functions Goto Github PK

View Code? Open in Web Editor NEW
22.0 7.0 9.0 10.86 MB

DAX Functions with Power BI

License: MIT License

R 46.22% TSQL 53.78%
powerbi dax function power-bi power-bi-dax measures ssas-tabular tabular-data r rprogramming

dax_functions's Introduction

DAX Functions and Power BI Samples

DAX Functions

Folder: 01_DAX_DimTime

DimTime =
     VAR V_Calendar = CALENDARAUTO()
RETURN
    GENERATE (
        V_Calendar;
        VAR V_Calendar_date = [Date]
        VAR LetoDatum = YEAR(V_Calendar_date)
        VAR Kvartal = CEILING(MONTH(V_Calendar_date)/3;1)
        VAR MesecCifra = MONTH(V_Calendar_date)
        VAR DanN = DAY(V_Calendar_date)
        VAR KonecMeseca = EOMONTH(V_Calendar_date; 0)
        VAR TedenCifra = WEEKNUM(V_Calendar_date; 2)
        VAR DanVTednu = WEEKDAY(V_Calendar_date;2)
        Return ROW(
            "Day"; V_Calendar_date;
            "OnlyDay"; DanN;
            "Year"; LetoDatum;
            "Month (number)"; MesecCifra;
            "Quarter"; Kvartal;
            "Month"; FORMAT(V_Calendar_date; "mmmm");
            "DayOfWeek"; DanVTednu;
            "NameOfWeek"; FORMAT(DanVTednu+1; "dddd");
            "Year Month"; FORMAT (V_Calendar_date; "mmm yy");
            "End Of Month"; FORMAT (KonecMeseca; "dd mmm yy");
            "Week Number"; TedenCifra
        )
    )

Power BI Examples

Folder: 02_Custom_FilterPane

DAX Examples for concatenating values of selected slicers:

Diamonds Clarity Selection = IF
(
ISFILTERED(diamonds[Clarity]);
SELECTEDVALUE(diamonds[clarity]; "Multiple colors selected");
"Filter not selected"
)
Diamonds Color Selections =
VAR Conc = CONCATENATEX(VALUES(diamonds[clarity]);
[Diamonds Clarity Selection];",")
RETURN(Conc)

Folder: 03_Measures_Copy

Power BI on copying mesures between datasets in same Power BI document using Power BI Template and Tabular Editor.

Tabular Editor to copy measures

Using Tabular Editor for copying measures

Folder: 04_Custom_Visual

Power BI custom visual can be prepared and exported using Charts PowerBI.Tips.

Charts PowerBI.Tips

Using Custom Power BI Visual

Folder: 05_Row_Level_security

Power BI example on using Row-level security.

RLS in work

Sample view of RLS in Power BI

Folder: 06_Measures_as_slicer

Power BI example on getting measures as a slicer in Power BI.

Slicer with Measures in work

View of slicer with measure names in Power BI

Cloning the repository

You can follow the steps below to clone the repository.

git clone -n https://github.com/tomaztk/DAX_Functions.git

License

These samples and templates are all licensed under the MIT license.

Questions

Email questions to: [email protected]

dax_functions's People

Contributors

tomaztk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.