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
MMartin
Frequent Visitor

Delete Matrix subtotal when i have 1 line with DAX

Hi guys!

 

We have the following, we have 2 levels, one for country and another for cities. On the other hand, we have a measure that formats the constitution date. I put the screenshot to see the stage:

I want to try to hide the constitution date for the country level. If you look at this I have achieved it when the country has 2 cities, but when I have only 1 city in that country it also shows it in the subtotal. For Example Spain has Jan.-20 however France is blank.

 

image.png

The measures is the next one:

 

Format Constitution Date =
VAR firsconstitutiondate =
LASTDATE(Data[Constitution Date])
VAR firsconstitutiondate_format =
FORMAT(
firsconstitutiondate,
"mmm.-yy"
)
var result =
IF (
HASONEVALUE(Data[City]),
firsconstitutiondate_format
)
return
result
 
any suggestions?
 
Thank in advance.
Best Regards.
 
 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@MMartin , I think isinscope should help you to control this better

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@MMartin , I think isinscope should help you to control this better

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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