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
AnaMass
Frequent Visitor

How to group a column for more than one column

I have the following model:

 

Capture2.PNG

 

I created a calsulated column to calculate the diff of days decorred between two dates and calculate column for the concatenate the productfamily with the material, other to concatenate plant with material, and othwr to concatenate plant with ProductFamily.

 

Now I need group the decorred days by the combinations that I have made. To do that I created the following:

 

Capture4.PNGCapture4.PNGCapture5.PNG

The result is the expected.

 

Capture6.PNG

 

However if I add to the visual the product family column that comes from the product family diumension, or the material that comes from the material dimension, it stops work.

 

Capture7.PNG

 

Does any one knows how to solve that situation in order to have the decorred days for plantmaterial,productfamilymaterial,plantproductfamily as I calculated and can use the material, plant and productfamily that comes from the dimensions?

 

Thank you

2 REPLIES 2
amitchandak
Super User
Super User

@AnaMass , Not very clear. But if you need value across rows in the same table use the earlier

 

example 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

 

Hi @amitchandak

 

Thank you for your answer.

 

I will try explain better:

 

The final goal is to have 3 measues the decorred number of days between today and a planned date, field that is stored in the fact table, for the MaterialPlant (this is a concatenate between material and Pland fields), MaterialProductFamily (this is a concatenate between material and ProductFamily fields), Plant and ProductFamily (this is a concatenate between Plant and ProductFamily fields).

 

1 - To create this concatenate fields, I used related to bring the material , ProductFamily  and plant fields from the dimension to the facttable and then I created calculated columns with the respective concatenations (combinations).

 

2 - I created a calculated column with the decorred days between the today date and the planed date calculation for each material. So I was able to measure ho far I regarding the planned orders date.

 

3 - I created 3 calculated tables with the summarize of each combination that I built previously and the avg of the decorred days for each one of them. Example: Capture4.PNG

 

It gaves the expected result at the avg level. However, if I create a visual table with that avg and the material field (that is created in dim material dimension), the avg results get the same value for every material. But if I use the material field that I created in the calculated table, it works. That means that I cannot use the avg by the material field from the material dimension in my table visual. 

 

I hope to be more clear now.

 

Thank you

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.