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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
k63
Regular Visitor

How to SumX over dynamic axis ?

Hello, 

 

I'd like to create a measure that performs a SumX of an indicator according to the axes I put in my table, for example :

 

k63_2-1716973806745.png

 

Here the MixEffectSumX measurement is good, the total is the expected number

But here the measurement only works for a specific axis (Item_Category)

 

My DAX formula : MixEffectSumX = SUMX(VALUES(Article[Item_Category]), [MixEffect])

 

The idea is that I would like to replace VALUES(Article[Item_Category]) with something that contains all the axes that I put in my table dynamically. Bearing in mind that I have ten or so dimensions and a hundred or so possible axes, the idea is that if I ever add axes in the future, I won't be obliged to modify this measure.

 

 

Does anyone have any clues?

Thanks in advance

6 REPLIES 6
Rupak_bi
Solution Specialist
Solution Specialist

please share sample data with some more axis you like to switch. will try



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

 Hi, how can i share you my pbi example ? 

PBI files upload is not supported here

Rupak_bi
Solution Specialist
Solution Specialist

You can paste sample data here in reply with all possible axis variability. 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Ok, here is some sample data that a used to test : 

A table Customer : 

CustomerIDCustomerCategoryCustomerSubCategory
1Category1SubCategory11
2Category2SubCategory21
3Category1SubCategory12
4Category2SubCategory22
5Category2SubCategory21
6Category3SubCategory31
7Category3SubCategory31
8Category3SubCategory32

A Table Product : 

ProductIDProductCategoryProductSubCategory
1Category1SubCategory11
2Category2SubCategory21
3Category1SubCategory12
4Category2SubCategory22
5Category2SubCategory21

 

A table Invoice :

ProductIDCustomerIDTurnover
115465
12543
131213
14154
255465
21215
222424
23104
244052
35720
3187
322
3442
3548
562
528
5127
54827
582
31782

 

The goal is to have the "correct" total (which is when the measure contains SumX)

k63_0-1717404369777.png

With the 5 following dax formulas : 

MixEffect = SUM('Invoice'[Turnover]) - 50
MixEffectWithSumXCustomerCategory = SUMX(VALUES(Customer[CustomerCategory]), [MixEffect])
MixEffectWithSumXCustomerSubCategory = SUMX(VALUES(Customer[CustomerSubCategory]), [MixEffect])
MixEffectWithSumXProductCategory = SUMX(VALUES('Product'[ProductCategory]), [MixEffect])
MixEffectWithSumXProductSubCategory = SUMX(VALUES('Product'[ProductSubCategory]), [MixEffect])
 
Here I created 4 differents measures, and the goal is to have an unique measure, and keeping in mind that I have more than 2 tables (with a lot of column :/)
 
Thanks in advance

 

Rupak_bi
Solution Specialist
Solution Specialist

Hi, 
@xifeng_L was right. This is not possible with the current data model. you need to restructur the model may be some other to optimiz the numbers of measure to create. Thanks



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/
xifeng_L
Super User
Super User

Based on my experience, there should be no solution to achieve this idea.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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