top of page
Antriksh Sharma

Antriksh Sharma

Writer

Analyst

More actions

Profile

Join date: Apr 7, 2021

Overview

First Name
Antriksh Sharma

Posts (91)

May 15, 20263 min
Pivot and Unpivot in DAX
Today, let's take a look at how to do Pivot and Unpivot in DAX. Ideally you would do this in SQL or Power Query but it never hurts to see how you could do same with DAX, infact you might get a better understanding of a very special DAX function. For Pivoting we are working with StudentsScore data. To PIVOT in SQL we could write following 2 queries that return different results depending on the requirement SELECT * FROM StudentScores AS S PIVOT ( SUM(Score) FOR Subject IN (English, Math,...

12
0
Apr 25, 20263 min
Get Rows from Previous Partition into Current Partition
Today, I am going to show you how to bring/join the rows of previous partition with the current partition in DAX, with the metrics for the previous rows in the current time frame. From the above image you can see there are 2 Customers in 2021 that are brought forward into 2022 with their Sales in 2021 and Sales in 2022. First order of business is to get TOPN Customers in each year and for that we can use TOPN paired with GENERATE or with WINDOW VAR N = 2 VAR TopCustomersEveryYear = ADDCOLUMNS...

82
0
1
Apr 17, 20261 min
How to Insert Blank Rows After Every Group in Excel and Power Query
Here is how to insert blank rows after each group, sample data: OrderID OrderDate Product Category Quantity NetPrice 1001 2025-01-01 Laptop Electronics 1 60000 1002 2025-01-02 Smartphone Electronics 2 42000 1003 2025-01-03 Headphones Accessories 3 4200 1004 2025-01-04 Laptop Electronics 1 65000 1005 2025-01-05 Smartphone Electronics 1 21000 1012 2025-01-12 Headphones Accessories 4 5500 With Excel's Dynamic Array Functions: =LET( Table, Sales, u, UNIQUE(Sales[Product]), n, 1, AppendBlanks,...

14
0
bottom of page