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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Adaz
Frequent Visitor

Summarize Compliance of Shopping Malls by Row Level Using Measure

Hello,

 I am trying to summarise the performance of kiosks within shopping malls using a measure. If a Kiosk Type is existing plus clean then this is considered a compliant Kiosk Type within a mall.

 

For example Kiosk Type A in Sunnyside Shopping Mall is compliant as it exists and clean.

However Kiosk Type B within the same Sunnyside Shopping mall is not compliant as the second Kiosk Type B (Kiosk TypeB2) is not clean.

 

My data looks like the following.

 

Mall Unique CodeShop NameKiosk TypeKiosk Type Unique CodeQuestionAnswer
1Bayswater Shopping MallKIOSK Type AKiosk Type ADoes this exist?No
1Bayswater Shopping MallKIOSK Type AKiosk Type AIs this clean?No
1Bayswater Shopping MallKIOSK Type BKIOSK Type BDoes this exist?Yes
1Bayswater Shopping MallKIOSK Type BKIOSK Type BIs this clean?Yes
1Bayswater Shopping MallKIOSK Type BKIOSK Type B2Does this exist?Yes
1Bayswater Shopping MallKIOSK Type BKIOSK Type B2Is this clean?Yes
2Sunnyside Shopping MallKIOSK Type AKiosk Type ADoes this exist?Yes
2Sunnyside Shopping MallKIOSK Type AKiosk Type AIs this clean?Yes
2Sunnyside Shopping MallKIOSK Type BKIOSK Type BDoes this exist?Yes
2Sunnyside Shopping MallKIOSK Type BKIOSK Type BIs this clean?Yes
2Sunnyside Shopping MallKIOSK Type BKIOSK Type B2Does this exist?Yes
2Sunnyside Shopping MallKIOSK Type BKIOSK Type B2Is this clean?No

 

The output I desire is below in this summary table.

 

Kiosk TypeNumber of Compliant Malls
KIOSK Type A1
KIOSK Type B1

 

Kiosk Type A is compliant in Sunnyside Shopping Mall.  (clean and existing)

Kiosk Type B is compliant in Bayswater Shopping Mall as both Kiosk Type Bs are compliant. (clean and existing)

 

My attempt

Measure 1

Kiosk Count

=
CALCULATE (
    COUNTROWS ( Table1 ),
    Table1[Question] = "Does this exist?",
    Table1[Answer ] = "Yes",
    ALLEXCEPT ( Table1, Table1[Mall Unique Code], Table1[Kiosk Type] )
)

 

Measure 2

Clean Count=
CALCULATE (
    COUNTROWS ( Table1 ),
    Table1[Question] = "Is this clean?",
    Table1[Answer ] = "Yes",
    ALLEXCEPT ( Table1, Table1[Mall Unique Code], Table1[Kiosk Type] )
)

 

Measure 3

DIVIDE([Kiosk Count],[Clean Count])
 
---------

If I pivot the Kiosk type and the second heirachy is by mall and I count the 1s (which represent 100%). I get the result I desire (just not in the above summary table)

I am trying to avoid using calculated columns and was wondering if it is possible to roll up the compliance using measures only in the summary table?


Any help would be appreciated.

Thank you all!

1 ACCEPTED SOLUTION
Adaz
Frequent Visitor

I think I figured this one out.

The following measure provides the result I am after

 

Number of Compliant Malls:=CALCULATE(DISTINCTCOUNT('Table1'[Mall Unique Code]),FILTER('Table1',[Measure 3]>=1))

 

If anyone has a different way of calculating this, I would be interested in hearing this.

Thank you all.

 

View solution in original post

2 REPLIES 2
Adaz
Frequent Visitor

Any help would be appreciated
Adaz
Frequent Visitor

I think I figured this one out.

The following measure provides the result I am after

 

Number of Compliant Malls:=CALCULATE(DISTINCTCOUNT('Table1'[Mall Unique Code]),FILTER('Table1',[Measure 3]>=1))

 

If anyone has a different way of calculating this, I would be interested in hearing this.

Thank you all.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.