Forum Discussion
IF
Post Prodigy
2 years agodax calculation with specific need
Hi, I am working on a power bi file which is loaded to : https://we.tl/t-dD2O8stykY I have 4 filters; city, region, town and month selection. The results are correct for city, region and month.
What i want is that I don't want to see any value if I select value from TownName. The card should be empty (not blank).
Can you help me on this?
Hi IF
Modify your formula for :TypeA = if(SELECTEDVALUE('CityTable'[CityName])= blank(),SWITCH(min(Main[_Flag_1]),1,Calculate(SUM(Main[Value1]),Main[_Flag_2]=1),2,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 2,Main[City]="#",Main[Town]="#"),3,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 3),4,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 4),BLANK()),"")result :if you need also to hide the category label
you can create Dax measure :If this post helps, then please consider Accepting it as the solution to help the other members find it more quicklyflagA = if('Main'[TypeA]="",1,0)and base of it makes the label white with conditional formatting:
1 Reply
- Ritaf1983
Super User
Hi IF
Modify your formula for :TypeA = if(SELECTEDVALUE('CityTable'[CityName])= blank(),SWITCH(min(Main[_Flag_1]),1,Calculate(SUM(Main[Value1]),Main[_Flag_2]=1),2,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 2,Main[City]="#",Main[Town]="#"),3,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 3),4,Calculate(SUM(Main[Value1]),Main[_Flag_2] = 4),BLANK()),"")result :if you need also to hide the category label
you can create Dax measure :If this post helps, then please consider Accepting it as the solution to help the other members find it more quicklyflagA = if('Main'[TypeA]="",1,0)and base of it makes the label white with conditional formatting: