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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ItoDiaz
Helper I
Helper I

Reversing my master tab

Hello, 

 

In Excel I have two tab, “Master” and “Red P”.  Initially, I needed use only “conformity toy” and “conformity CP” columns in Power BI. 

 

Now I need to show in a Histogram conformity of each CP, (I have 23 CP columns) by day. To have a good visual I « need » to reverse my 23 columns in rows and my date column in  columns (problem I have 8423 rows because date column is a datatime type). I would use SUMPRODUCT in excel (see "red P" tab). It means to create at least 366 columns (one by day) by year!!! I think it is a pity to use Power BI only to create visuals. I would like to do this table in Power BI and make it automatic because, of course, I will update my database “Master” with new data each day.  

 

My “Red P” tab show an example of “reversed matrix” in Excel when I only needed to show conformity in YTD and for the current month. It also show what I need as visual.     

 

Please, I just started using Power BI, could you give some ideas with good descriptions of steps to do it (in Power BI)? And the useful DAX or query M functions…  

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

@ItoDiaz ,

 

You can use DAX fucntion SUMX() which is same with SUMPRODUCT() in excel. For more details, please refer to the doc:

https://docs.microsoft.com/en-us/dax/sumx-function-dax

 

Regards,

Jimmy Tao

@v-yuta-msft 

 

Thank you for your answer. 

 

I have posted my question (and explained it better) in the right place to do it 😅... I had my answer !!

 

https://community.powerbi.com/t5/Power-Query/Translate-SUMPRODUCT-using-a-Query-Power-BI/m-p/1140847...

 

BR

ItoDiaz
Helper I
Helper I

@v-yuta-msft 

 

Yes, I have tried it at least four times, but PBI don't answer and I must stop process of the task. That is only the first question. 

 

I think I dind't clearly described my real question : how could I "Translate" this operation from excel in PBI? 

=100*(SUMPRODUCT((Mastertable[CP xx]=1)*(Mastertable[Date]=REDtable[Date]*1))/(SUMPRODUCT((Mastertable[CP xx]>=0)*(Mastertable[Date]=REDtable[Date]*1))"

 

Knowing I have 23 CP xx and I need to do the same operation for each one by day.  And I want to have my "CP xx" in rows.

 

ex : 

PCPDate 1Date 2Date 3....
CP_CONDUCT_AAresult aresult b.... 
CP_TEMP_AAresult xx........ 
CP_BRO_AA    

 

v-yuta-msft
Community Support
Community Support

@ItoDiaz ,

 

Have you tried "Pivot Column" in query editor?

1.PNG 

 

Regards,

Jimmy Tao

ItoDiaz
Helper I
Helper I

Here my excel file with master tab and Red P tab 

 

Test file 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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