Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Need to replicate the below formulas in power bi:
IF
[Campaign Start Date] = [Date]
THEN
[Campaign Name]
ELSE
NULL
END
IF
COUNTD([Campaign Launching]) = 0
THEN NULL
ELSE
COUNTD([Campaign Launching])
END
Any suggestions ?
Solved! Go to Solution.
Hi @UditJ ,
I created some data:
Table1:
Table2:
Are you referring to COUNTD in Tableau, this function returns the number of items in a group , nULL values are not counted.
How to use Count and Count Distinct in Tableau (rigordatasolutions.com)
Here are the steps you can follow:
1. Create measure.
The first function:
IF =
IF(
'Table'[Campaign Start Date]='Table'[Date],
'Table'[Campaign Name],BLANK())
The second function:
It can be judged without IF, and it will automatically be displayed as Blank() when it does not match.
CountD =
CALCULATE(
DISTINCTCOUNT('Table2'[Campaign Launching]),
FILTER(ALL(Table2),'Table2'[ID]=EARLIER('Table2'[ID])&&'Table2'[Campaign Launching]<>BLANK()))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @UditJ ,
I created some data:
Table1:
Table2:
Are you referring to COUNTD in Tableau, this function returns the number of items in a group , nULL values are not counted.
How to use Count and Count Distinct in Tableau (rigordatasolutions.com)
Here are the steps you can follow:
1. Create measure.
The first function:
IF =
IF(
'Table'[Campaign Start Date]='Table'[Date],
'Table'[Campaign Name],BLANK())
The second function:
It can be judged without IF, and it will automatically be displayed as Blank() when it does not match.
CountD =
CALCULATE(
DISTINCTCOUNT('Table2'[Campaign Launching]),
FILTER(ALL(Table2),'Table2'[ID]=EARLIER('Table2'[ID])&&'Table2'[Campaign Launching]<>BLANK()))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @UditJ
First check this links:
https://learn.microsoft.com/dax/if-function-dax?WT.mc_id=DP-MVP-5004936
https://learn.microsoft.com/dax/blank-function-dax?WT.mc_id=DP-MVP-5004936
https://learn.microsoft.com/dax/date-function-dax?WT.mc_id=DP-MVP-5004936
then use below with DAX:
1-
IF([Campaign Start Date] = [Date],[Campaign Name],blank())
2-
IF (COUNTD([Campaign Launching]) = 0,blank(),COUNTD([Campaign Launching]))
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
User | Count |
---|---|
98 | |
90 | |
83 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |