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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
BieBel
Frequent Visitor

Calculated measure by row I cannot get it to work ...

I have to calculate the room surfaces for different room types => RM[RM_CAT] is not BATHROOM or BASEMENT.
I got the measure to 'work' as far as the roomtypes, but I need to (re)group the total surface by building RM[BL].
So I have to add another part to my measure. Alas, I can't get it to work.
Can anyybody please help?

 

 

AREA_T = CALCULATE(
SUM(RM[AREA]),
FILTER(RM,
(RM[RM_CAT] <> "BATHROOM") ||
(RM[RM_CAT] <> "BASEMENT")
))

...

 

12 REPLIES 12
Anonymous
Not applicable

Hi @BieBel,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Vinay Pabbu

Anonymous
Not applicable

Hi @BieBel,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Vinay Pabbu

Anonymous
Not applicable

Hi @BieBel,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Vinay Pabbu

BieBel
Frequent Visitor

rm_type(Multiple Items)
  
Row LabelsSum of area
00089,89
0013302,75
00141,58
00157,8
0016992,73
0018566,51
0024307,39

  rm_type has been filtered in this pivot

Hi @BieBel ,

As I understand, you want data in details for all room types except Basement and Bathroom while your total needs to be at bl_id with all rooms considered.

You can use the below DAX to get it

 

 

RoomArea = IF(ISINSCOPE(Table1[rm_type]), CALCULATE([TotalArea], FILTER(Table1, AND(Table1[rm_type] <> "BASEMENT", Table1[rm_type]<>"BATHROOM"))), IF(ISINSCOPE(Table1[bl_id]), CALCULATE ( [TotalArea], ALLEXCEPT ( 'Table1', 'Table1'[bl_id] ) )))

 

 

TotalArea = SUM(Table1[area])

 

Thejeswar_0-1741958476218.png

 

If this solves your question, mark it as solution and appreciate with a Kudo !

 

Regards,

 

 

 

BieBel
Frequent Visitor

bl_idrm_fl_blrm_typearea
00080008-00-00.05TECHNICAL9,89
00130013-00-00.05PARKING57,87
00130013-00-00.07WORKSHOPS170,2
00130013-00-00.14PARKING31,24
00130013-00-00.15PARKING32,3
00130013-00-00.19STAIRS2,15
00130013-00-00.23STORAGE3,34
00130013-01-01.01BATHROOM40,37
00130013-01-01.04BATHROOM13,56
00130013-01-01.05STORAGE3,73
00130013-01-01.07STAIRS1,92
00130013-02-02.01BASEMENT92,79
00140014-00-00.12TECHNICAL1,58
00150015-00-00.22TECHNICAL4,31
00150015-00-00.36TECHNICAL3,49
00160016-00-00.01PARKING43,2
00160016-00-00.07PARKING134,87
00160016-00-00.08PARKING53,89
00160016-00-00.21BATHROOM45,18
00160016-00-00.26WORKSHOPS53,21
00160016-00-00.28OFFICES15,44
00160016-00-00.34WORKSHOPS660,84
00160016-00-00.36STORAGE14,73
00160016-00-00.41STORAGE16,55
00180018-00-00.01STAIRS3,03
00180018-00-00.09STORAGE4,47
00180018-00-00.11RESTAURANT55,27
00180018-00-00.13STAIRS2,23
00180018-00-00.14WORKSHOPS262,13
00180018-00-00.16STAIRS0,98
00180018-00-00.22STORAGE8,18
00180018-M01-M01.01STAIRS2,34
00180018-M01-M01.05PARKING226,49
00180018-M01-M01.06STAIRS1,39
00180018-M01-M01.07BATHROOM15,9
00180018-M01-M01.08BATHROOM32,83
00210021-00-00.24BATHROOM30,45
BieBel
Frequent Visitor

bl_id every building has got it's 4-digit ID
rm_fl_bl identifies a single room on a single floor in a single building
rm_type type of room
area 
BieBel
Frequent Visitor

BieBel_0-1741606940745.jpeg

 

danextian
Super User
Super User

Hi @BieBel 

I am not sure what exactly you want to achieve as you did not provide a sample data and your expected result from the same but try these:

AREA_ = 
CALCULATE (
    SUM ( RM[AREA] ),
    KEEPFILTERS ( NOT RM[RM_CAT] IN { "BATHROOM", "BASEMENT" } )
)

AREA_BY_BUILDING = 
CALCULATE ( [AREA_], ALLEXCEPT ( RM, RM[BL] ) )

danextian_0-1741599840932.png

Please see the attached sample pbix.

 

Otherwise, please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

BieBel_0-1741604551607.jpeg 

BieBel_1-1741604693515.png

 

 

Hi, thanks ...

I applied your code, buth both measures return the same numbers (no division by BL_ID)

I know you requested an excel or Power BI, yet I cannot figure out how to share it here. So I did take snaps. The table in Power BI is called 'RM'. Field names are unchanged.

Hi @BieBel 

 

Both measures are expected to return the same result at the bl_id level as the result of the first measure is applied to all rows for each bl_id unless you meant something else by this statement:

 

I have to calculate the room surfaces for different room types => RM[RM_CAT] is not BATHROOM or BASEMENT. I got the measure to 'work' as far as the roomtypes, but I need to (re)group the total surface by building RM[BL].

 

If you want the total area for each bl_id regardless of the room type, you can try this:

Area by bl_id =
CALCULATE ( SUM ( 'Table'[area] ), ALLEXCEPT ( 'Table', 'Table'[bl_id] ) )

danextian_0-1741607980348.png

If this isnt' what you're looking for, please show us your expected result given the same sample data.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @BieBel ,
Snaps will not help.

You can just copy your excel data and past it here. It will get pasted as text that can be copied and used

 

Regards,

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.

Top Solution Authors