<img src="https://secure.leadforensics.com/133892.png" alt="" style="display:none;">

FormelsprĂ„ket som anvĂ€nds i Power BI heter DAX. SprĂ„ket utgörs av ett stort antal funktioner med konstanter och operatorer vilka anvĂ€nds i formler och uttryck för att berĂ€kna ett eller flera vĂ€rden. DAX skapar helt enkelt ny information utifrĂ„n data som redan finns i din datamodell. 

Funktionerna i DAX delar vi in i följande grupper: DATETIME, FILTER, INFO, LOGICAL, MATHTRIG, PARENTCHILD, STATISTICAL, TEXT, TIMEINTELLIGENCE samt OTHER.

DAX Function: SUM

Reference group: MATHTRIG

Att summera ihop vĂ€rden Ă€r ett vanligt förekommande moment nĂ€r du arbetar med numerisk data. I Power BI kan det göras pĂ„ olika sĂ€tt beroende pĂ„ hur din datamodell ser ut. Finns alla vĂ€rden du vill summera i en kolumn gör du det enkelt med SUM-funktionen. Finns inte alla vĂ€rden i en kolumn utan Ă€r uppdelade i tvĂ„ eller fler kolumner t ex det du behöver summera Ă€r lagrat per enhet i tvĂ„ olika kolumner, ”Antal sĂ„lda enheter” i en kolumn och ”Pris per enhet” i en annan kolumn. DĂ„ kan du först rĂ€kna ut summan för varje enhets försĂ€ljning och spara vĂ€rdet i en ny kolumn för att sedan anvĂ€nda SUM-funktionen pĂ„ den nya kolumnen.

Det finns andra sÀtt att lösa detta utan att behöva skapa nya kolumner i datamodellen men det tar vi upp i en annan blogg. HÀr visar vi summering genom att summera ihop en befintlig eller en nyskapad kolumn.

SUM generar inte en ny kolumn utan returnerar ett berÀknat vÀrde, ett sÄ kallat Measure. Measures lagras inte i datamodellen utan berÀknas vid varje tillfÀlle de anropas. Beroende pÄ hur ett Measure anvÀnds genereras olika resultat. Exempel pÄ andra anvÀndningar av Measures tar vi upp i andra bloggar.

SUM function (DAX)

SUM-funktionen returnerar summan av alla vÀrden i en kolumn i en tabell och kan endast anvÀndas pÄ numeriska kolumner. I kolumnhÀnvisningen kan Àven tabellnamnet anges.

Syntax: SUM(<column>)

I exempel 1 anvÀnder vi en tabell som heter DATA_4 med 4 kolumner enligt nedan:

Screenshot 2019-05-26 at 18.14.25

Exempel 1

I exemplet summerar vi ihop vĂ€rden i kolumnen Summa. Measure ”Total” anvĂ€nds och innehĂ„ller summan.
Total = 5623

För att berĂ€kna ”Total” anvĂ€nder vi följande syntax:
Total = SUM(’DATA_4’[Summa])

Exempel 2

I exempel 2 anvÀnder vi en tabell som heter DATA_3 med 3 kolumner enligt nedan:
Screenshot 2019-05-26 at 18.14.38
Först lĂ€gger vi till en kolumn som vi kallar ”SummaNy” och tabellen fĂ„r följande utseende:
Screenshot 2019-05-26 at 18.14.50
För lĂ€gga till kolumn ”SummaNy” anvĂ€nder vi följande syntax:
SummaNy = ‘DATA_3’[Antal]* ‘DATA_3’ [Pris]

Sedan summerar vi ihop vĂ€rden i kolumnen SummaNy. Measure ”TotalNy” anvĂ€nds och innehĂ„ller summan.
TotalNy = 2990

För att berĂ€kna ”TotalNy” anvĂ€nder vi följande syntax:
TotalNy = SUM(’DATA_3’[SummaNy])

Flera MATHTRIG funktioner (DAX)

Ovan har du fÄtt exempel pÄ hur du kan summera vÀrden i kolumner med SUM-funktionen. Det finns ytterligare 44 MATHTRIG-funktioner i Power BI. Vill du veta mer vilka MATHTRIG-funktioner som finns i Power BI kan du ladda ner vÄr Power BI applikation som visar alla MATHTRIG-funktioner.

Ladda ner MATHTRIG

För att kunna anvÀnda Power BI applikationen behöver du ha Power BI Desktop installerad pÄ din dator. Power BI Desktop Àr gratis och kan laddas ner hÀr.

Vi kan naturligtvis hjÀlpa till med installation och att komma igÄng med PBI.

HĂ„ll utkik efter ytterligare blogginlĂ€gg. 

Prenumerera pÄ bloggen

Diskutera detta inlÀgg

Rekommenderad lÀsning

If you organize your data and use AI strategically, you can make better decisions faster. You can for example improve your market understanding and forecasting, optimize your maintenance or reduce food waste. Choose what is most important for you!
Demand forecasters do the impossible — predict what products and services customers want in the future. Their forecasts inform decision-making about production and inventory levels, pricing, budgeting, hiring and more. "While crystal balls remain imaginary, machine learning (ML) methods can give global supply chain leaders the support they need in the real world to create more accurate forecasts." The goal is to produce exactly the amount of product to meet demand. No more. No less. Demand forecasting is used to anticipate the demand with enough time to manufacture the right stock to get as close to this reality as possible. The cost is high if you don’t get it right. Your customers will go to your competitors if you don’t have what they need. Unfortunately, capacity, demand and cost aren’t always known parameters. Variations in demand, supplies, transportation, lead times and more create uncertainties. Ultimately demand uncertainties greatly influence supply chain performance with widespread effects on production scheduling, inventory planning and transportation. On the heels of the global pandemic, supply chain disruptions and a pending economic downturn, many demand forecasters wish for a crystal ball. While crystal balls remain imaginary, machine learning (ML) methods can give global supply chain leaders the support they need in the real world to create more accurate forecasts.
If you have identified possible AI use cases for your business, the next step will be to test if they are possible to implement and if they will create great value. While there is a lot of momentum and excitement about using AI to propel your business, the reality is only 54% of AI projects are deployed. How do you ensure you’re one of the businesses that does unlock the new opportunities AI promises? Your success with AI begins by discovering AI use cases that work for your business. In the first blog of our Columbus AI blog series, we shared five areas where organizations should focus their efforts to generate ideas for AI implementations based on our experience. After generating some ideas for AI use cases that could potentially benefit your company from the first step of the Columbus AI Innovation Lab, the next step is to test which AI use cases could be operationalized by evaluating them. Columbus AI Innovation Lab
Only half of the companies starting an AI pilot project are actually executing it. The key is to choose an idea that will benefit your business. Read more about how! In 2022, 27% of chief information officers confirmed they deployed artificial intelligence (AI), according to a Gartner AI survey. Even though businesses across all industries are turning to AI and machine learning, prepare your organization before jumping on the AI bandwagon by considering a few factors. Ask yourself: Is AI necessary for achieving the project requirements or is there another way? Does your team have the skills to support AI and machine learning? How will AI impact your current operations if you adopt it? How will you integrate AI with existing systems? What are the data, security and infrastructure requirements of AI and machine learning? The Gartner AI survey found only 54% of projects made it from the pilot phase to production. After significant investment in AI, why aren’t companies deploying it? We found the problem begins when companies define a use case. Too often, companies are not identifying AI use cases that benefit their businesses and end-users will adopt. The question is then, how should companies unlock the value and new opportunities AI promises? It starts with a systematic approach for each stage of the AI life cycle. We developed the Columbus AI Innovation Lab, a comprehensive method to address and account for all challenges when adding AI to your business operations and bring stakeholders into the process at the right time to help you operationalize AI.
It doesn’t matter how good your artificial intelligence technology is. If you have bad data, you’ll get bad results. While AI is one of the most innovative and impactful innovations for businesses today, bad data can prevent AI projects from getting off the ground. Having high-quality data and following data preparation best practices are crucial for a successful AI project. In the Transform phase of the Columbus AI Innovation Lab, the one we detail here, data is collected and prepared for use by AI and machine learning (ML) algorithms. Major phases in Machine Learning Machine learning, frequently used synonymously with “artificial intelligence,” is about using predictive methods to simplify tasks. There are several essential steps to building ML models, and these steps can change based on the issue you are trying to solve and the kind of ML model you are building. However, in general, the steps involved in creating and implementing an ML model are as follows: Define: Different approaches for finding AI use cases Discover: Scope and prioritize ideas before developing an AI solution and implementation strategy Transform: Transforming the business case including data acquisition and preparation with AI/ML (current blog) Model and evaluate: Analyze and enhance the business use cases using AI/ML algorithms Deploy and support: Deployment of AI/ML models and support/monitoring to guarantee quality and effectiveness
right-arrow share search phone phone-filled menu filter envelope envelope-filled close checkmark caret-down arrow-up arrow-right arrow-left arrow-down right-arrow share search phone phone-filled menu filter envelope envelope-filled close checkmark caret-down arrow-up arrow-right arrow-left arrow-down