Forum Discussion
Create column filled with measures
Here is a excel version of the table I want to generate in power BI. The markerd values are these measures I calculated from a larger dataset using COUNTA and FILTER in the following way
Q12015 delay over 2h = CALCULATE(COUNTA(Test[Delay]);FILTER(ALL(Test[Delay]);Test[Delay]>0,08333335);FILTER(ALL(Test[Date].[Year]);Test[Date].[Year]=2015);FILTER(ALL(Test[Date].[MonthNo]);Test[Date].[MonthNo]<7))
Now that I have these measures I would like to generate a table as in the picture and add the measures as columns circled with blue, I don't know if the Calculated Columns work because I need to put a different DAX function for each row (because the Quarter changes)
Hi OskariNi,
Here is how you can do it in Power BI:
1. Pull in your columns required for the measure calculation and other columns if you need to showcase them in the table.
2. When the data is loaded in Power BI, right click on your table and Create Measure. Use the same DAX to create your 3 measures which you used in Excel.
3. When all the measures are created, Drag a table visual on the canvas.
4. Drag all the 5 columns which you showcased in the screenshot.
5. Now start dragging your 3 measures, you will see the exact same table as it was in Excel.
Let me know if you face any issues.
Prateek Raina
- OskariNi8 years agoHelper I
Hi prateekraina,
Thank's for the reply. The thing is that I don't really want to see the table on the canvas. I wan't to have the table as data in the FIELDS part and then use it to draw a bar chart like this:
Thanks, Oskari
- prateekraina8 years agoMemorable Member
Hi OskariNi,
Well, that will simply increase the data size of the report.
You can create the bar chart without having to do so.
Still, if you want to do that only, then you need to create Calculated Columns instead of measure to achieve that. However, i doubt that you present DAX formula may not work as is, you will have to change it to get same results as measure.
If you want to go with ideal scenario, you must use measures.
Prateek Raina
- OskariNi8 years agoHelper I
Hi, prateekraina
How can I create a bar chart if the X-axis is defined with a column of periods (H1,H2...) and the values are defined with measures. I can't figure it out. If I just add the measures individually in the Values field the result is this