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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
sam_nik12345
Helper II
Helper II

row-wise multiplication

My table looks like below:

productfactJan'18Feb'18Mar'18
b1.5234

 

I want add another row to achieve like below:

q SUM(Jan'18) *factSUM(Jan'18) *factSUM(Jan'18) *fact

 

How can I achieve this? Kindly help.

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @sam_nik12345 ,

By my test, add a row is not supported by DAX, you can add a calculated column instead, here's my solution.

1.This is my sample.

vkalyjmsft_0-1641804577847.png

2.In Power Query, select all columns at the same time, then click Unpivot Columns tab under the Transform ribbon.

vkalyjmsft_2-1641804777922.png

vkalyjmsft_1-1641804743230.png

Get this result.

vkalyjmsft_3-1641804955671.png

3.Click Use First Row as Headers tab under the Transform ribbon, and rename the Product column.

vkalyjmsft_4-1641805144071.png

Get this result.

vkalyjmsft_5-1641805266901.png

4.Create a measure.

P =
IF (
    MAX ( 'Table'[Date] ) = "Fact",
    BLANK (),
    MAX ( 'Table'[b] )
        * MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Date] = "Fact" ), 'Table'[b] )
)

Get the result.

vkalyjmsft_6-1641805521975.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @sam_nik12345 ,

By my test, add a row is not supported by DAX, you can add a calculated column instead, here's my solution.

1.This is my sample.

vkalyjmsft_0-1641804577847.png

2.In Power Query, select all columns at the same time, then click Unpivot Columns tab under the Transform ribbon.

vkalyjmsft_2-1641804777922.png

vkalyjmsft_1-1641804743230.png

Get this result.

vkalyjmsft_3-1641804955671.png

3.Click Use First Row as Headers tab under the Transform ribbon, and rename the Product column.

vkalyjmsft_4-1641805144071.png

Get this result.

vkalyjmsft_5-1641805266901.png

4.Create a measure.

P =
IF (
    MAX ( 'Table'[Date] ) = "Fact",
    BLANK (),
    MAX ( 'Table'[b] )
        * MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Date] = "Fact" ), 'Table'[b] )
)

Get the result.

vkalyjmsft_6-1641805521975.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

 

 

amitchandak
Super User
Super User

@sam_nik12345 , Assume month is row in you data, you can try a measure like

Prd= PRODUCTX(Values('Date'[Month Year]), [Measure])

 

You can push this grand total using isinscope

if(not(isinscope('Date'[Month]), [Prd],[Measure] )

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

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

Hi @amitchandak , i think this has something to do with insertrow dax function?

@sam_nik12345 , Can you share raw data(table) to check and how actually want to display.

 

We might append the results like

 

 

example

union(
summarize('Table',"Measure","sales","This period",[SALES YTD],"Last period",[SALES LYTD],"POP",[SALES YOY])
summarize('Table',"Measure","unit","This period",[unit YTD],"Last period",[unit LYTD],"POP",[unit YOY])
)

 

 

or


union(
summarize('Table','Table'[country],"Revenue","sales","This period",[Revenue YTD],"Last period",[Revenue LYTD],"POP",[Revenue YOY])
summarize('Table','Table'[country],"Costs","unit","This period",[Costs YTD],"Last period",[Costs LYTD],"POP",[Costs YOY])
)

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

Hi @amitchandak 

I want to create a row, multiplying the fact with every month.

Jan'18 *fact, Feb'18*fact, Mar'18*fact

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.