Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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!!
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 June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
92 | |
89 | |
70 | |
69 |
User | Count |
---|---|
228 | |
128 | |
117 | |
83 | |
82 |