Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Creating DAX measures for sum, count, share, share change vs YA,etc

Hi my fellow power BI users, I have been wracking my head for a solution to this PBI assignment, I am pretty new to the PBI so while I was able to handle power query and all, I wanted to figure out the DAX measures for this, as this is the requirement (create measures).

So, we were asked to unpivot some fact columns causing all the metrics to be in one column and all the values in the adjacent column. Then we were asked to make a summary table by grouping segment, manufacturer and brand and then aggregate the fact columns. I didn't know how to do that without including the metric column too so I added that too.

 

ajinkya_1999_0-1637222855510.png

Here, you can see how the summary table looks like and I need to create seperate measures for each that:

  • calculate sum and count
  • Share and Share change vs YA
  • sum of Value Sales for 12 months based on month selected

For the sum, I was able to come up with something like: 

1 Measure = CALCULATE(SUM('Appended Table'[Metrics]),'Summary Table'[Total])

However I am not sure if its possible to calculate the sum for something in total column using the adjacent "Metric" row as a filter to what it should calculate
  •  
  •  
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , based on what I got. A measure like

 


Sumx(addcolumns(summarize('Appended Table', 'Appended Table'[segment], 'Appended Table'[manufacturer]) , "_mes" ,
Switch(True() ,
max(Table[Metric]) in {"A", "B"} , SUM('Appended Table'[Metrics]) ,
COUNT('Appended Table'[Metrics])
)), [_mes])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.