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
gopik8000
New Member

columns into rows with help of dax

Hi Team,

 

I have requirement like this in Table visual using like AC, Fridge, Fan, TV are calculated new measures and month 1 and month 2 and month 3 are coming new column .

TimeACFridgeFanTV
Month 1 2689
Month 25537
Month37623

 

i want result has like transpose into with help of Dax i required

TimeframeMonth 1 Month 2Month3
AC257
Fridge656
Fan832
TV973
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi  @gopik8000 ,

Here are the steps you can follow:

1. Create calculated table.

Flag1 =
UNION(
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "AC", "Target", 'Table'[AC]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "Fridge", "Target", 'Table'[Fridge]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "Fan", "Target", 'Table'[Fan]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "TV", "Target", 'Table'[TV]))

vyangliumsft_0-1689574352412.png

True =
var _table1=
DISTINCT('Flag1'[Timeframe])
return
SUMMARIZE(
    _table1,[Timeframe],
    "Month 1",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 1"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]),
    "Month 2",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 2"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]),
    "Month 3",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 3"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]))

2. Result:

vyangliumsft_1-1689574352414.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Thanks alot it's working fine 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi  @gopik8000 ,

Here are the steps you can follow:

1. Create calculated table.

Flag1 =
UNION(
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "AC", "Target", 'Table'[AC]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "Fridge", "Target", 'Table'[Fridge]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "Fan", "Target", 'Table'[Fan]),
SELECTCOLUMNS('Table', "Month", 'Table'[Time], "Timeframe", "TV", "Target", 'Table'[TV]))

vyangliumsft_0-1689574352412.png

True =
var _table1=
DISTINCT('Flag1'[Timeframe])
return
SUMMARIZE(
    _table1,[Timeframe],
    "Month 1",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 1"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]),
    "Month 2",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 2"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]),
    "Month 3",SUMX(FILTER(ALL('Flag1'),'Flag1'[Month]="Month 3"&&'Flag1'[Timeframe]=EARLIER('Flag1'[Timeframe])),[Target]))

2. Result:

vyangliumsft_1-1689574352414.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks alot it's working fine 

gopik8000
New Member

Ac, Fridge , TV,Fan are Calculated measures can't use other than values field                                                              

TimeframeMonth 1 Month 2Month3
AC257
Fridge656
Fan832
TV973
some_bih
Super User
Super User

Hi @gopik8000 just replace row / columns in table / matrix view.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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