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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Siboska
Helper II
Helper II

Seeking Solutions for Data Model Issues

I have a data model that I'm struggling to solve, and I'm unsure if a solution exists.

The data model is structured as follows:

Siboska_0-1696572865184.png

The "Project" table is central and filters the "Risk" table in a 1-to-many relationship. There is also a relationship between the "Project" and "Action" tables, which is also 1-to-many.


The "Risk" table is connected to the "Project" table as previously mentioned. Additionally, there's an inactive 1-to-many relationship from the "Risk" to the "Actions" table.


The "Action" table contains rows that can have either a Project ID, a Risk ID, or both.


I have two slicers. One filters based on the "Project" columns, and the other filters based on the "Risk" columns. I want the flexibility to use both slicers individually or simultaneously.

Desired Output: My goal is straightforward: I want a table based on the "Action" table displaying all action names without any additional calculations.

My initial approach was to create a measure that could serve as a filter for the table visual, as illustrated below:

RiskFilterTest = 
VAR CurrentActionRisk = MAX('TableActions'[pmi_Risk])
VAR SelectedRisks = ALLSELECTED('Project risks')
RETURN
    IF(
        NOT ISEMPTY(SelectedRisks),
        CALCULATE(
            IF(
                CurrentActionRisk IN VALUES('Project risks'[pum_RiskId]),
                1,
                0
            ),
            USERELATIONSHIP('TableActions'[pmi_Risk], 'Project risks'[pum_RiskId])
        ),
        1
    )

 

ProjectFilterTest = 
VAR CurrentActionProject = MAX('TableActions'[ProjectId])
VAR SelectedProject = ALLSELECTED('Project')
RETURN
    IF(
        NOT ISEMPTY(SelectedProject),
        IF(CurrentActionProject IN VALUES('Project'[ProjectId]), 1, 0),
        1
    )

 

CombinedFilterTableMethod = 
VAR RiskTable = 
    FILTER(
        'TableActions',
        [RiskFilterTest] = 1
    )

VAR ProjectTable = 
    FILTER(
        'TableActions',
        [ProjectFilterTest] = 1
    )

VAR CombinedTable = 
    UNION(
        SELECTCOLUMNS(RiskTable, "ActionId", 'TableActions'[pmi_ActionId]),
        SELECTCOLUMNS(ProjectTable, "ActionId", 'TableActions'[pmi_ActionId])
    )

VAR CurrentActionId = MAX('TableActions'[pmi_ActionId])

RETURN 
    IF(CONTAINS(CombinedTable, [ActionId], CurrentActionId), 1, 0)


And then I apply it to the visual:

Siboska_1-1696573751861.png

 

However, I'm encountering an issue with the output. While the risk slicer functions as expected, utilizing the project slicer causes everything to go blank. I'm also concerned about the scalability of this approach. If I need to incorporate more tables into the logic in the future, this method might become problematic.

A quick note: Splitting the "Action" table into two separate tables is not a viable solution for me.

In summary, I'm seeking alternative approaches to address this challenge. If anyone has suggestions, I would greatly appreciate it.



 

3 REPLIES 3
lbendlin
Super User
Super User

Are "Actions"  and "Risks"  on the same level (independent facts) or do Risks control actions?

Risk can and must control action. And actions can also be directly controlled by Projects. 

Do projects control risks?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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