Skip to main content

Posts

Showing posts with the label Power BI

DAX in Power BI

DAX introduction PPT slides: Click here DAX queries video course which is free and recommended by Microsoft for POWER BI. https://www.sqlbi.com/learn/introducing-dax-video-course/ Dax formatter:  http://www.daxformatter.com/

Power BI

Power BI ref guide:  https://docs.microsoft.com/en-us/power-bi/desktop-what-is-desktop Introduction Power BI Desktop is a free application you can install on your local computer that lets you connect to, transform, and visualize your data. With Power BI Desktop, you can connect to multiple different sources of data, and combine them (often called modeling) into a data model that lets you build visuals, and collections of visuals you can share as reports, with other people inside your organization. Most users who work on Business Intelligence projects use Power BI Desktop to create  reports, and then use the Power BI service to share their reports with others. The most common uses for Power BI Desktop are the following: Connect to data Transform and clean that data, to create a data model Create visuals, such as charts or graphs, that provide visual representations of the data Create reports that are collections of visuals, on one or more report pages Share ...

Power BI, IF condition

Create a calculated column that uses an IF function Stores table has a column named Status, with values of "On" for active stores and "Off" for inactive stores, which we can use to create values for our new Active StoreName column. Your DAX formula will use the logical IF function to test each store's Status and return a particular value depending on the result. If a store's Status is "On", the formula will return the store's name. If it’s "Off", the formula will assign an Active StoreName of "Inactive". 1. Create a new calculated column in the Stores table and name it Active StoreName in the formula bar. DAX Expression: Active StoreName = IF([Status]="On",[StoreName],"Inactive") Store Table fields: Final Output:

In Power BI, What is RELATED function

DAX formulas can leverage the full power of the model you already have, including relationships between different tables that already exist. We can apply DAX expressions the new column For example, I have "ProductCategory" table and "ProductSubCategory" table Data table fields: Data OutPut: DAX Formula: ProductFullCategory = RELATED(ProductCategory[ProductCategory])& " - " &[ProductSubcategory] from above expression, RELATED is the dax function which will join two columns. ProductFullCategory is the column created in ProductSubCategory table with DAX function. Inside Related function, we have to specify which table we need the columns and its column name.