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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
timba_bng
New Member

Help adding dynamic filter to run a query against a dataset

Hello, I copied this DAX query from Performance analyzer. I want to be able to be able to make the output dynamic by the  ManagerReport'[name_manager] slicer in the report. The output always pulls all the name_manager column data in the report.@v-yiruan-msft gave a solution for something similar but I've been unable to achieve this. Please help.

 

// DAX Query
DEFINE
VAR __DS0Core = 
FILTER(
KEEPFILTERS(
VALUES('ManagerReport'[name_manager])),
AND('ManagerReport'[name_manager]= MAX('ManagerReport'[name_manager])
AND(
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(
ROLLUPGROUP(
'ManagerReport'[name_manager],
'ManagerReport'[name_employee],
'ManagerReport'[Color Coding],
'ManagerReport'[content_title]
), "IsGrandTotalRowTotal"
),
"MinColor_Coding", IGNORE(CALCULATE(MIN('ManagerReport'[Color Coding])))
)
),
OR(
OR(
OR(
NOT(ISBLANK('ManagerReport'[name_manager])),
NOT(ISBLANK('ManagerReport'[name_employee]))
),
NOT(ISBLANK('ManagerReport'[Color Coding]))
),
NOT(ISBLANK('ManagerReport'[content_title]))
)
)
VAR __DS0PrimaryWindowed = 
TOPN(
502,
__DS0Core,
[IsGrandTotalRowTotal],
0,
'ManagerReport'[name_manager],
1,
'ManagerReport'[name_employee],
1,
'ManagerReport'[Color Coding],
1,
'ManagerReport'[content_title],
1
)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC,
'ManagerReport'[name_manager],
'ManagerReport'[name_employee],
'ManagerReport'[Color Coding],
'ManagerReport'[content_title]

 

1 REPLY 1
ghoshabhijeet
Solution Supplier
Solution Supplier

@timba_bng Thanks for posting your query.

 

Would request you to share some sample data or if possible the pbix file to work on. Thanks!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.