Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
good.
I think it's a simple thing, but I can't get it to work for me in Power Bi, I want to put a card that according to one IF shows one type of measure or another.
The problem I have in the table that I want to compare, I want if the value of a column is to 0 I will show a sum(total19) and if this to 1 shows an average(Average19). The idea is like this:
Card - If (Type-0, Total19, Average19)
Total - SUM(Rows[Value])
Solved! Go to Solution.
Hi @Syndicate_Admin ,
According to the test file you provided, I did the following test:
Result =
VAR a =
CALCULATE ( SUM ( Hoja1[Valor] ), FILTER ( ALL ( Hoja1 ), Hoja1[Año] = 2019 ) )
VAR b =
CALCULATE (
AVERAGE ( Hoja1[Valor] ),
FILTER ( ALL ( Hoja1 ), Hoja1[Año] = 2019 )
)
RETURN
IF ( MAX ( Hoja1[Tipo] ) = 1, a, b )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Below is test pbix file.
Hi @Syndicate_Admin ,
According to the test file you provided, I did the following test:
Result =
VAR a =
CALCULATE ( SUM ( Hoja1[Valor] ), FILTER ( ALL ( Hoja1 ), Hoja1[Año] = 2019 ) )
VAR b =
CALCULATE (
AVERAGE ( Hoja1[Valor] ),
FILTER ( ALL ( Hoja1 ), Hoja1[Año] = 2019 )
)
RETURN
IF ( MAX ( Hoja1[Tipo] ) = 1, a, b )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Below is test pbix file.
@Syndicate_Admin , do need something like a measure slicer ?
refer my video if that can help
How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M
or
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hello I have created an example, it is simple, a single table in which I have two filters, and what I want on a single card, that if it is type 1 show me the total and if the type 0 shows me the average
Thank you
User | Count |
---|---|
98 | |
76 | |
69 | |
53 | |
27 |