Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |