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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ChoiJunghoon
Helper III
Helper III

How to create measure of the countrow values at variable table ?

Hello. I have a big problem.

 

 Table1

ModuleID| StatusScore| Sequence| Loction
A101A
A102B
A113C
A205D
A203E
A204F
A311A
A3102B
A313C
A404D
A4205E
A406F
A507A
A508B
A509C

 

Table2

ModuleID
A1

 

Table3  ** Relationship (Table1[Location)

Location
A
B
C
D
E
F

-----------------------------------------------------------

create Measure value 

 

Measure = 
VAR x0 = 

SUMMARIZE (
    FILTER (
        Table1,
        NOT ( Table1[ModuleID] IN VALUES ( 'Table2'[ModuleID] ) )
    ),
    Table1[ModuleID],
    "SUM_", SUM ( Table1[StatusScore] ),
    "LastSequence", MAX ( Table1[Sequence] ),
    "location",CALCULATE(max(Table1[Loction]),Table1[Sequence] = MAX ( Table1[Sequence] ))
)

VAR x1=
FILTER(x0,[SUM_]=0)
RETURN 

COUNTROWS(x1)

 

 

and I add the table in the report. (Display) 

 

LocationMeasure
A1
B1
C1
D2
E1
F2

 

but , I want to display below table by using (x1) table. 

LocationMeasure
C1
D1

 

Could you let me know what is wrong ? 

 

1 ACCEPTED SOLUTION

try this:

Measure = 
VAR x0 =
    SUMMARIZE(
        FILTER( Table1, NOT ( Table1[ModuleID] IN VALUES( 'Table2'[ModuleID] ) ) ),
        Table1[ModuleID],
        "SUM_", SUM( Table1[StatusScore] ),
        "LastSequence", MAX( Table1[Sequence] ),
        "location",
            CALCULATE(
                MAX( Table1[Loction] ),
                FILTER( Table1, Table1[Sequence] = MAX( Table1[Sequence] ) )
            )
    )
VAR x1 =
    FILTER( x0, [SUM_] = 0 )
RETURN
    COUNTROWS( x1 )

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

Hi @ChoiJunghoon 

 

It because of the relation between those table1 and table3,remove that relation and test it again.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

sorry, After remove relation. 

 

LocationMeasure
A2
B2
C2
D2
E2
F2

 

try this:

Measure = 
VAR x0 =
    SUMMARIZE(
        FILTER( Table1, NOT ( Table1[ModuleID] IN VALUES( 'Table2'[ModuleID] ) ) ),
        Table1[ModuleID],
        "SUM_", SUM( Table1[StatusScore] ),
        "LastSequence", MAX( Table1[Sequence] ),
        "location",
            CALCULATE(
                MAX( Table1[Loction] ),
                FILTER( Table1, Table1[Sequence] = MAX( Table1[Sequence] ) )
            )
    )
VAR x1 =
    FILTER( x0, [SUM_] = 0 )
RETURN
    COUNTROWS( x1 )

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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