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...
- 2 years ago
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:
Ritaf1983
Super User
2 years agoHi 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 quickly
you can create Dax measure :
flagA = if('Main'[TypeA]="",1,0)
and base of it makes the label white with conditional formatting: