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.
Hi,
I am having the below column as DAX measure. Can anyone help me in writing the same statement while creating Custom Column.
Count of Comapnies = SWITCH(
'Data - Unpivot'[Fund - Copy], "Omega IV", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy]= "Omega IV")), "Omega V", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy] = "Omega V")), "Omega VI", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy] = "Omega VI")))
Hi @Pooji
You can use “if then else “ in Power Query . For specific content, please refer to the following link .
https://docs.microsoft.com/en-us/powerquery-m/m-spec-conditionals
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yeah @amitchandak
I am getting error, when am trying to create custom column using the below formula. Please help me in achieving this.
@Pooji , if this a measure then what you given can work as measure
'Data - Unpivot'[Fund - Copy]
If the above is column for measure you need
max('Data - Unpivot'[Fund - Copy]) or selectedvalue('Data - Unpivot'[Fund - Copy])
else the above should work as column too
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
User | Count |
---|---|
56 | |
54 | |
53 | |
47 | |
30 |
User | Count |
---|---|
173 | |
89 | |
70 | |
46 | |
45 |