cancel
Showing results for 
Search instead for 
Did you mean: 
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/



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

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/



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors