The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a measure which counts the number of stores opening on certain months and i was wanting to create a new column with these values if it is possible ?
Any suggestions ?
Solved! Go to Solution.
Yes, you can create a new column in Power BI using the values from a measure, but it requires a bit of a workaround since measures and columns behave differently. Here’s a step-by-step guide to help you achieve this:
Create a Calculated Column:
StoreOpeningsColumn = [StoreOpenings]
Using a Calculated Table:
StoreOpeningsTable = SUMMARIZE( 'YourTable', 'YourTable'[Month], "StoreOpenings", [StoreOpenings] )
Using Variables in Measures:
StoreOpeningsWithVariable = VAR Openings = [StoreOpenings] RETURN Openings
These methods should help you incorporate the measure values into a new column or table. If you need more detailed guidance, there are many tutorials and community forums that can provide a...
Also Follow given below link, i hope this will help you:
Solved: Turning a measure into a column - Microsoft Fabric Community
Solved: Column Based on Values From a Measure - Microsoft Fabric Community
Yes, you can create a new column in Power BI using the values from a measure, but it requires a bit of a workaround since measures and columns behave differently. Here’s a step-by-step guide to help you achieve this:
Create a Calculated Column:
StoreOpeningsColumn = [StoreOpenings]
Using a Calculated Table:
StoreOpeningsTable = SUMMARIZE( 'YourTable', 'YourTable'[Month], "StoreOpenings", [StoreOpenings] )
Using Variables in Measures:
StoreOpeningsWithVariable = VAR Openings = [StoreOpenings] RETURN Openings
These methods should help you incorporate the measure values into a new column or table. If you need more detailed guidance, there are many tutorials and community forums that can provide a...
Also Follow given below link, i hope this will help you:
Solved: Turning a measure into a column - Microsoft Fabric Community
Solved: Column Based on Values From a Measure - Microsoft Fabric Community
Thanks in your 2nd example what does the "storeopenings" in brackets refer to please ? STruggling to get P Bi to accept my code when i try this
StoreOpeningsTable = SUMMARIZE( 'YourTable', 'YourTable'[Month], "StoreOpenings", [StoreOpenings] )
In the SUMMARIZE function, "StoreOpenings" in brackets refers to the name of the new column that will be created in the summarized table. The [StoreOpenings] part is supposed to be the measure or column that you want to summarize.
Here’s a breakdown of the SUMMARIZE function:
If Power BI is not accepting your code, it might be due to the [StoreOpenings] measure not being defined correctly. Ensure that you have a measure named [StoreOpenings] in your model. For example:
Define the Measure:
StoreOpenings = COUNTROWS(FILTER('YourTable', 'YourTable'[OpeningDate] = [SelectedMonth]))
Use the Measure in SUMMARIZE:
StoreOpeningsTable = SUMMARIZE( 'YourTable', 'YourTable'[Month], "StoreOpenings", [StoreOpenings] )
If you don’t have a measure named [StoreOpenings], you need to create it first. Here’s a complete example:
Create the Measure:
StoreOpenings = CALCULATE( COUNTROWS('YourTable'), FILTER('YourTable', MONTH('YourTable'[OpeningDate]) = MONTH(TODAY())) )
Create the Summarized Table:
StoreOpeningsTable = SUMMARIZE( 'YourTable', 'YourTable'[Month], "StoreOpenings", [StoreOpenings] )
Make sure that [StoreOpenings] is correctly defined and available in your model before using it in the SUMMARIZE function. If you still encounter issues, please share the specific error message you’re getting, and I’ll be happy to help further!
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
13 | |
9 | |
7 |