The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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, @THENNA_41
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, @THENNA_41
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
18 | |
18 | |
17 | |
15 | |
13 |
User | Count |
---|---|
36 | |
35 | |
19 | |
18 | |
18 |