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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JamesBurke
Helper III
Helper III

Dynamic

HI all , 

 

Test = 
 var sourcetable = FILTER(SUMMARIZECOLUMNS('Date'[Date],'Emporia Devices'[Wawrick Device Name (groups)],"RankMeasure",[Rank DeviceName Usage]),'Emporia Devices'[Wawrick Device Name (groups)] = "Thornton Building")
RETURN
COUNTX(FILTER(sourcetable,[RankMeasure] = 3),[RankMeasure])

 

This works but i would like to make it dynamic so whenever a building is selected it does this same result 

 

Test 2 = 
 var sourcetable = FILTER(SUMMARIZECOLUMNS('Date'[Date],'Emporia Devices'[Wawrick Device Name (groups)],"RankMeasure",[Rank DeviceName Usage]),SELECTEDVALUE('Emporia Devices'[Wawrick Device Name (groups)] ))
RETURN
COUNTX(FILTER(sourcetable,[RankMeasure] = 1),[RankMeasure])

 

This says can't convert type of text to true/False 

 

Thanks , James. 

 

1 ACCEPTED SOLUTION
ajohnso2
Super User
Super User

You missed some code.

 

Test 2 = 
 var sourcetable = FILTER(SUMMARIZECOLUMNS('Date'[Date],'Emporia Devices'[Wawrick Device Name (groups)],"RankMeasure",[Rank DeviceName Usage]), 'Emporia Devices'[Wawrick Device Name (groups)] = SELECTEDVALUE('Emporia Devices'[Wawrick Device Name (groups)] ))
RETURN
COUNTX(FILTER(sourcetable,[RankMeasure] = 1),[RankMeasure])

View solution in original post

1 REPLY 1
ajohnso2
Super User
Super User

You missed some code.

 

Test 2 = 
 var sourcetable = FILTER(SUMMARIZECOLUMNS('Date'[Date],'Emporia Devices'[Wawrick Device Name (groups)],"RankMeasure",[Rank DeviceName Usage]), 'Emporia Devices'[Wawrick Device Name (groups)] = SELECTEDVALUE('Emporia Devices'[Wawrick Device Name (groups)] ))
RETURN
COUNTX(FILTER(sourcetable,[RankMeasure] = 1),[RankMeasure])

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.