Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Data Sampple:
Local FPV'[prod Cat] Local FPV'[Markets] Local FPV'[Cigarettes Per Pack (Product Information)] Local FPV'[Cigarettes Per Outer (*)]
0 CA04 180 180
0 CA04 18 180
0 CA04 180 180
0 TW04 122 50
1 DE04 50 88
already measures are created based on the condition
Local FPV'[prod Cat]= 0 then [#Gross_FPV]
Local FPV'[prod Cat]= 1 then [#Gross_otp]
Current Dax
#G =
Var selval=SELECTEDVALUE('Local FPV'[prod Cat],"Nothing Selected")
RETURN
ROUND(IF(selval=0,[#Gross_FPV],IF(selval=1,[#Gross_otp],BLANK())),3)
Now i want add new calculation if below condtion match then [#Gross_180_cal]
Local FPV'[prod Cat] Local FPV'[Markets] Local FPV'[Cigarettes Per Pack (Product Information)] Local FPV'[Cigarettes Per Outer (*)]
0 CA04 180 180
IF( Local FPV'[prod Cat] =0 && Local FPV'[Cigarettes Per Pack (Product Information)]=180 && Local FPV'[Cigarettes Per Outer (*)=180]
#Gross_FPV_180
IF( Local FPV'[prod Cat] =0 && Local FPV'[Cigarettes Per Pack (Product Information)]<>180 && Local FPV'[Cigarettes Per Outer (*)<>180]
[#Gross_FPV]
IF Local FPV'[prod Cat]= 1 then [#Gross_otp]
created DAX but [#Gross_FPV_180], this condition code not working
Var selval = SELECTEDVALUE('Local FPV'[prod Cat], "Nothing Selected")
Var market = SELECTEDVALUE('Local FPV'[Markets], "Unknown Market")
Var cigpack=SELECTEDVALUE('Local FPV'[Cigarettes Per Pack (Product Information)],"Nothing selectd")
var cigouter=SELECTEDVALUE('Local FPV'[Cigarettes Per Outer (*)],"Nothing selected")
RETURN
ROUND(
SWITCH(
TRUE(),
selval = 0 && cigpack =180 && cigouter=180, [#Gross_FPV_180],
selval = 0 && cigpack <> 180 && cigouter= <>180, [#Gross_FPV],
selval = 1, [#Gross_otp],
BLANK()
),
3
)
selval = 0 && cigpack =180 && cigouter=180, [#Gross_FPV_180] this condition not working .please any one help me ..
Solved! Go to Solution.
Hi, @Anonymous
Based on the data you provided and the DAX expression, I tested that it works. Here are some of the how-to procedures:
I created three measures using the following DAX expression:
#Gross_FPV = 0
#Gross_FPV_180 = 1
#Gross_otp = -1
I created a condition using the DAX expression you provided:
I created a table visual and tested this condition:
If you see #Gross_FPV_180=1 in measure, you have no problem with your DAX expression. I've uploaded the test file below for you to preview.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on the data you provided and the DAX expression, I tested that it works. Here are some of the how-to procedures:
I created three measures using the following DAX expression:
#Gross_FPV = 0
#Gross_FPV_180 = 1
#Gross_otp = -1
I created a condition using the DAX expression you provided:
I created a table visual and tested this condition:
If you see #Gross_FPV_180=1 in measure, you have no problem with your DAX expression. I've uploaded the test file below for you to preview.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |