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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
ryanmkan
Regular Visitor

Combining dynamic information

Hello,

 

I have data that is structured like this

CATPERIODAMOUNT
a1x
b1x
c1x
a2x
b2x
c2x
a3x
b3x
c3x
a4x
b4x
c4x

 

The user is able to select period ranges for category A and B, and then seperately for category C. 
Example, sum the amounts for category A and B from period 1-2, and for category C from period 3-4.

There are no rules to offset the period, it is purely down to selection.

I want to be able to calculate the amounts per category, but then recombine it all into one table so that other columns (category grouping, and higher hierarchical information) can be displayed in a single matrix.

Am really stuck!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ryanmkan 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1718934628281.png

 

Create measures.

 

 

Measure = 
IF(
    SELECTEDVALUE('Table'[CAT]) = "a" 
    || 
    SELECTEDVALUE('Table'[CAT]) = "b",
    CALCULATE(
        SELECTEDVALUE('Table'[AMOUNT]),
        FILTER(
            'Table', 
            'Table'[CAT] in {"a", "b"} && 'Table'[PERIOD] in {1, 2}
        )
    ),
    CALCULATE(
        SELECTEDVALUE('Table'[AMOUNT]), 
        FILTER(
            'Table', 
            'Table'[CAT] = "c" && 'Table'[PERIOD] in {3, 4}
        )
    )
)

 

 

 

Measure 2 = SUMX('Table', 'Table'[Measure])

 

 

Create a matrix.

 

vnuocmsft_1-1718934747303.png       

 

vnuocmsft_2-1718934765597.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ryanmkan 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1718934628281.png

 

Create measures.

 

 

Measure = 
IF(
    SELECTEDVALUE('Table'[CAT]) = "a" 
    || 
    SELECTEDVALUE('Table'[CAT]) = "b",
    CALCULATE(
        SELECTEDVALUE('Table'[AMOUNT]),
        FILTER(
            'Table', 
            'Table'[CAT] in {"a", "b"} && 'Table'[PERIOD] in {1, 2}
        )
    ),
    CALCULATE(
        SELECTEDVALUE('Table'[AMOUNT]), 
        FILTER(
            'Table', 
            'Table'[CAT] = "c" && 'Table'[PERIOD] in {3, 4}
        )
    )
)

 

 

 

Measure 2 = SUMX('Table', 'Table'[Measure])

 

 

Create a matrix.

 

vnuocmsft_1-1718934747303.png       

 

vnuocmsft_2-1718934765597.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.