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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jyaul1122
Helper III
Helper III

Include based on slicer

Hello All,

I have two tables dimenstion and fact :

Jyaul1122_0-1759038140834.png

Jyaul1122_1-1759038153933.png

Which are related with Project column(one to many). And I have  Project  slicer (from Dimension table).

I wrote measure: Risk value=max(Fact table(Risk value).

What I need, when there is no selection in Project slicer it will display all Project like:

Jyaul1122_2-1759038519232.png

If there is  Project slicer selected, there result will be rows of that project but keep also row for Include(A/B) Project for that District:

For example: if I selected Project P1 from slicer the result will be: 

Jyaul1122_3-1759038725421.png

 if Project P1 and P2 are selected then result will be:

Jyaul1122_4-1759038787835.png

same way If project P3 or P4 will be selected from District B then its needs to include Project include Project B

Jyaul1122_5-1759038897709.png

If P1 and P3 are selected then: 

Jyaul1122_6-1759038956503.png

means whenever any project are selected from slicer then its need to bring also Project Include ( A or B) for that District.

How can I achieve using meausres ?

 

Sample data:

Dimension Table
DistrictProject
AP1
AP2
AInclude A
BP3
BP4
BInclude B

 

FACT Table  
DistrictProjectMonthRisk Value
AP125-Jan1
AP225-Feb2
BP325-Feb3
BP425-Mar3
AP125-Apr4
AInclude A25-May2
BInclude B25-Aug3
1 ACCEPTED SOLUTION

Yes I can

 

You need a table like this though,

 

FBergamaschi_0-1759066859368.png

 

File again in the same location

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

View solution in original post

6 REPLIES 6
v-dineshya
Community Support
Community Support

Hi @Jyaul1122 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @FBergamaschi , Thank you for your prompt response.

 

Hi @Jyaul1122 ,  Could you please try the proposed solution shared by @FBergamaschi .  Let us know if you’re still facing the same issue we’ll be happy to assist you further.

 

Regards,

Dinesh

FBergamaschi
Solution Sage
Solution Sage

To obtain what you are looking for, there are two ways:

 

1 - all in DAX

 

2 - getting help from the tables

 

To make it fast, I choosed option 2, here is the file for you to inspect

 

https://drive.google.com/drive/folders/1ygPYgruaZZy8Spvekfe4j6qd_N2eng7n?usp=sharing

 

If you need a full DAX solution keeping your tables, I shall look into that, I think it is feasible but will need a bit more time

 

Best

 

If this helped, please consider giving kudos and mark as a solution

@mein replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

@FBergamaschi 

I would appreciated via DAX. Thanks

Done, same location folder

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

@FBergamaschi 

Thanks for your reply but I can not write condition for more than 200 unique Projects.

VAR Selection = VALUES ( Dim[Project] )
VAR SelectionExpandedA = UNION( Selection, {"Include A"} )
VAR SelectionExpandedB = UNION( Selection, {"Include B"} )
VAR SelectionExpandedAB = UNION( Selection, {"Include A"},{"Include B"}  )
VAR Result=
IF (
    ("P1" IN Selection || "P2" IN Selection) && ("P3" IN Selection || "P4" IN Selection),
    CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedAB )),
    IF (
          "P1" IN Selection || "P2" IN Selection,
CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedA ) ),
IF (
          "P3" IN Selection || "P4" IN Selection,
          CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedB ))
)
    ))
    RETURN Result
 
 
Could you please do needfull ? Thanks

Yes I can

 

You need a table like this though,

 

FBergamaschi_0-1759066859368.png

 

File again in the same location

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.