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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.