Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |