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
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/

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/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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! Prices go up Feb. 11th.

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.