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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BI___guy
Regular Visitor

How to Mimic Pivot / Unpivot in a DAX Expression (Measure)?

Hi there,

 

Is it possible to do operations on multiple, specific values in a column, using another column as reference to choose which values? Please see sample data below.

 

Time                    Parameter                    Value                    
12:00 AMTemp.20
6:00 AMTemp.21
12:00 PMTemp.20
6:00 PMTemp.19
12:00 AMWind Spd.2.1
6:00 AMWind Spd.2.4
12:00 PMWind Spd.2.3
6:00 PMWind Spd.2.1
12:00 AMHumidity0.99
6:00 AMHumidity0.99
12:00 PMHumidity0.98
6:00 PMHumidity0.99

 

For example, let's say I want a measure to multiply (Temperature) * (Wind Speed) * (Humidity) for each time stamp. Then, putting our measure as the "values" in a PBI matrix visual with Time as the "rows", would be a 2x4 matrix where each time stamp has one value for measure.

 

Pivot/Unpivot in PQ would work well to re-organize the data such that corresponding T, WS, and H values were all in the same row, but due to the size of the dataset I am working with as well as other constraints, pivot/unpivot is not an option. For similar reasons, I cannot use a summarize table or calculated columns. I must do this with measures. Is it possible?

 

Many thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @BI___guy,

If you are working with largest number of records, I'd like to suggest you create multiple dimension tables with different category fields and use them to design matrix visual.

After these steps, you can write a measure formula to look up original table records to calculate result based on current row and column category values.

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @BI___guy,

If you are working with largest number of records, I'd like to suggest you create multiple dimension tables with different category fields and use them to design matrix visual.

After these steps, you can write a measure formula to look up original table records to calculate result based on current row and column category values.

Regards,

Xiaoxin Sheng

wdx223_Daniel
Super User
Super User

Measure=SUMX(VALUES(Table[Time]),CALCULATE(PRODUCT(Table[Value])))

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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