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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Aruljoy
Helper II
Helper II

Selected column function for measure

Hi All,
 
I want to create a new data set based on existing using selected columns. 
 
Test1 = SELECTCOLUMNS(TransactionData,"MemberID",TransactionData[MemID],"FailOnlyFlag",COUNTROWS ( FILTER ( VALUES ( 'TransactionData'[MemID] ) , [Measure_SuccessCount] = 0 ) ))

 

[Measure_SuccessCount] = 

CALCULATE(countrows(TransactionData),FILTER(TransactionData,TransactionData[TransactionTypeDerived]="success"))
 
getting the following error "Aruljoy_1-1646252557612.png"
 
Can anyone help me how to achieve this?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Aruljoy ,

 

Please try using below formula to create a new table.

test1 =
var _count = CALCULATE(countrows(TransactionData), FILTER(TransactionData, TransactionData[TransactionTypeDerived]="success"))
return
SELECTCOLUMNS(TransactionData, "MemberID", TransactionData[MemID], "FailOnlyFlag", calculate(COUNTROWS('TransactionData'), Filter(ALLEXCEPT(TransactionData, TransactionData[MemID]), _count=0)))

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Aruljoy ,

 

Please try using below formula to create a new table.

test1 =
var _count = CALCULATE(countrows(TransactionData), FILTER(TransactionData, TransactionData[TransactionTypeDerived]="success"))
return
SELECTCOLUMNS(TransactionData, "MemberID", TransactionData[MemID], "FailOnlyFlag", calculate(COUNTROWS('TransactionData'), Filter(ALLEXCEPT(TransactionData, TransactionData[MemID]), _count=0)))

 

Best Regards,

Jay

amitchandak
Super User
Super User

@Aruljoy , This should be create as table, you are creating as measure

Test1 = SELECTCOLUMNS(TransactionData,"MemberID",TransactionData[MemID],"FailOnlyFlag",COUNTROWS ( FILTER ( VALUES ( 'TransactionData'[MemID] ) , [Measure_SuccessCount] = 0 ) ))

 

Slicer values will not work with calculated table , better create a var in measure

 

Test1 =

var _tab = SELECTCOLUMNS(TransactionData,"MemberID",TransactionData[MemID],"FailOnlyFlag",COUNTROWS ( FILTER ( VALUES ( 'TransactionData'[MemID] ) , [Measure_SuccessCount] = 0 ) ))

return

countrows(_tab)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.